:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --ink: #142033;
  --muted: #667085;
  --line: #d8dfeb;
  --page: #edf3f8;
  --panel: #ffffff;
  --blue: #2563eb;
  --green: #15855b;
  --red: #d13f38;
  --shadow: 0 18px 44px rgba(35, 49, 76, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
}

button {
  font: inherit;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

select {
  min-height: 50px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 14px;
  line-height: 1.6;
}

label {
  display: block;
  margin: 18px 0 8px;
  color: #2d374c;
  font-weight: 800;
}

.student-shell {
  min-height: 100vh;
  padding: 28px;
}

.student-stage {
  width: min(1120px, 100%);
  margin: 0 auto;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 14px;
  font-size: 20px;
}

.student-badge {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  min-height: 54px;
  padding: 0 22px;
}

.action-panel,
.score-panel,
.result-panel,
.number-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.action-panel {
  display: grid;
  place-items: center;
  gap: 20px;
  min-height: 420px;
  padding: 34px;
  text-align: center;
}

.readiness {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 10px 16px;
  font-weight: 700;
}

.readiness.is-ready {
  border-color: rgba(21, 133, 91, 0.32);
  color: var(--green);
}

.timer {
  font-size: clamp(56px, 10vw, 108px);
  font-weight: 900;
  line-height: 1;
}

.primary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  width: min(720px, 100%);
}

.record-button,
.grade-button {
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  min-height: 96px;
  padding: 0 24px;
}

.record-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--red);
}

.record-button.is-recording {
  background: var(--green);
}

.record-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.24);
}

.grade-button {
  background: var(--blue);
}

.grade-button:disabled,
.record-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.live-status {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.result-wrap {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 18px;
  margin-top: 20px;
}

.score-panel {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
}

.score-ring {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  border: 12px solid rgba(37, 99, 235, 0.16);
  border-top-color: var(--blue);
  border-radius: 50%;
}

.score-ring span {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}

.score-ring small {
  color: var(--muted);
  font-size: 14px;
}

.level {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 28px;
  font-weight: 900;
}

.result-panel {
  padding: 22px;
}

.result-panel.wide {
  grid-column: 1 / -1;
}

.result-panel p {
  margin-bottom: 0;
  line-height: 1.7;
}

.dimension {
  display: grid;
  grid-template-columns: 106px 1fr 50px;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.bar {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #e8edf5;
}

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

.dimension-comment {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.issue {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.issue strong {
  color: var(--blue);
}

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

ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}

.number-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background: rgba(237, 243, 248, 0.96);
  padding: 24px;
}

.number-gate[hidden] {
  display: none;
}

.number-panel {
  width: min(860px, 100%);
  padding: 28px;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.number-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  min-height: 58px;
}

.number-button:active {
  background: var(--blue);
  color: #fff;
}

@media (max-width: 900px) {
  .student-shell {
    padding: 20px;
  }

  .student-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .student-badge {
    width: 100%;
  }

  .action-panel {
    min-height: 440px;
  }

  .primary-actions,
  .result-wrap {
    grid-template-columns: 1fr;
  }

  .number-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 520px) {
  .student-shell {
    padding: 14px;
  }

  .action-panel,
  .result-panel,
  .score-panel,
  .number-panel {
    padding: 18px;
  }

  .score-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .record-button,
  .grade-button {
    min-height: 78px;
  }
}

.teacher-shell {
  min-height: 100vh;
  padding: 28px;
}

.teacher-stage {
  width: min(1220px, 100%);
  margin: 0 auto;
}

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

.teacher-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  padding: 11px 18px;
}

.teacher-status.is-live {
  border-color: rgba(21, 133, 91, 0.32);
  color: var(--green);
}

.teacher-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 18px;
}

.teacher-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.teacher-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.start-button,
.stop-button,
.clear-results-button {
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  min-height: 54px;
  padding: 0 18px;
}

.start-button {
  background: var(--green);
}

.stop-button {
  background: var(--red);
}

.clear-results-button {
  background: #5b667a;
}

.start-button:disabled,
.stop-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.results-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

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

.submission-card,
.empty-results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  padding: 16px;
}

.submission-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 20px;
  font-weight: 900;
}

.submission-top span {
  color: var(--blue);
}

.submission-summary {
  margin: 10px 0 8px;
  line-height: 1.55;
}

.submission-meta,
.empty-results {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 960px) {
  .teacher-shell {
    padding: 20px;
  }

  .teacher-header,
  .results-head {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-grid,
  .submissions {
    grid-template-columns: 1fr;
  }
}
