:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667280;
  --line: #d9dfdd;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --navy: #082545;
  --green: #17473b;
  --gold: #c7a970;
  --rose: #7a2333;
  --sky: #e8f1f4;
  --shadow: 0 22px 60px rgba(8, 37, 69, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

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

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(320px, 1.1fr);
  background:
    linear-gradient(90deg, rgba(8, 37, 69, 0.9), rgba(23, 71, 59, 0.48)),
    url("./assets/login-education-background.png") center / cover;
}

.login-brand {
  align-self: start;
  justify-self: start;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: clamp(26px, 5vw, 54px);
  color: #ffffff;
}

.login-panel,
.signup-panel {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: min(440px, calc(100% - 32px));
  border: 1px solid rgba(216, 222, 220, 0.9);
  border-radius: 8px;
  padding: clamp(26px, 5vw, 42px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.signup-panel {
  grid-column: 2;
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.login-panel h1 {
  margin: 0 0 26px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.14;
  letter-spacing: 0;
}

.login-panel label,
.signup-panel label {
  display: block;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-panel input,
.signup-panel input,
.signup-panel select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.login-intro {
  margin: -12px 0 20px;
  color: var(--muted);
  line-height: 1.65;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

.login-panel button,
.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 8px;
  font-weight: 850;
}

.login-panel button,
.primary-button {
  width: 100%;
  padding: 13px 16px;
  background: var(--green);
  color: #ffffff;
}

.login-panel button {
  margin-top: 22px;
}

.panel-secondary-button {
  margin-top: 10px !important;
  background: #ffffff !important;
  color: var(--green) !important;
  border: 1px solid var(--line) !important;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button,
.ghost-button {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--navy);
}

.login-hint,
.login-error {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 750;
}

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

.login-error {
  color: var(--rose);
}

.validation-summary {
  min-height: 0;
}

.validation-summary ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.validation-summary li {
  margin: 4px 0;
}

.field-invalid {
  border-color: rgba(122, 35, 51, 0.7) !important;
  background: #fff8f8 !important;
}

.login-public-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(216, 222, 220, 0.72);
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.panel-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.panel-form-header h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

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

.full-label {
  margin-top: 8px;
}

.consent-row {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--ink) !important;
  line-height: 1.55;
}

.consent-row input {
  width: auto;
  margin-top: 3px;
}

.field-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 20px;
  background: var(--navy);
  color: #f8f6ef;
}

.brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(199, 169, 112, 0.65);
  border-radius: 8px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}

.brand strong,
.brand small,
.login-brand strong,
.login-brand small {
  display: block;
}

.brand small,
.login-brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  text-transform: uppercase;
}

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

.nav-list a {
  border-radius: 8px;
  padding: 12px 14px;
  color: rgba(248, 246, 239, 0.75);
  font-weight: 800;
}

.nav-list a.active,
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.student-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.student-card span,
.student-card small,
.timer-card span,
.panel-badge,
.eyebrow,
.status-chip {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.student-card span,
.student-card small {
  color: rgba(255, 255, 255, 0.68);
}

.student-card small {
  overflow-wrap: anywhere;
}

.student-card strong {
  display: block;
  margin: 6px 0 4px;
  overflow-wrap: anywhere;
}

.exam-main {
  padding: clamp(18px, 3vw, 34px);
}

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

.topbar h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: 0;
}

.session-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timer-card {
  min-width: 132px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.timer-card strong {
  display: block;
  margin-top: 2px;
  color: var(--green);
  font-size: 22px;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: clamp(26px, 4vw, 46px);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(8, 37, 69, 0.95), rgba(23, 71, 59, 0.86)),
    var(--navy);
  color: #ffffff;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 8px 0 14px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(30px, 3.8vw, 48px);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.status-chip {
  display: inline-block;
  width: fit-content;
  padding: 6px 10px;
  border: 1px solid rgba(199, 169, 112, 0.65);
  border-radius: 999px;
  color: #f1dba8;
}

.hero-metrics,
.detail-grid,
.analysis-grid {
  display: grid;
  gap: 12px;
}

.hero-metrics article,
.detail-grid article,
.analysis-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(216, 222, 220, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.hero-metrics span,
.detail-grid span,
.analysis-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.hero-metrics strong,
.detail-grid strong,
.analysis-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--navy);
  font-size: 22px;
}

.exam-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: 22px;
  margin-bottom: 22px;
}

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

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 26px);
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(8, 37, 69, 0.07);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel h3 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.panel-badge {
  width: fit-content;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--green);
  white-space: nowrap;
}

.exam-list {
  display: grid;
  gap: 12px;
}

.subject-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.subject-picker .secondary-button.active {
  border-color: rgba(23, 71, 59, 0.65);
  background: #f2f8f4;
  color: var(--green);
}

.exam-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.exam-item.active {
  border-color: rgba(23, 71, 59, 0.6);
  background: #f4f8f5;
}

.exam-item span,
.exam-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.exam-item strong {
  display: block;
  margin: 5px 0;
  color: var(--navy);
  font-size: 17px;
}

.exam-description {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.profile-list,
.report-steps {
  display: grid;
  gap: 10px;
}

.profile-row,
.report-step {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.profile-row span,
.report-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.profile-row strong,
.report-step strong {
  color: var(--navy);
  overflow-wrap: anywhere;
}

.report-step.active {
  border-color: rgba(23, 71, 59, 0.48);
  background: #f2f8f4;
}

.report-access-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(23, 71, 59, 0.22);
  border-radius: 8px;
  background: #f8fbf9;
}

.report-access-panel[hidden] {
  display: none;
}

.report-access-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.report-link {
  display: inline-flex;
  width: fit-content;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.trial-actions {
  display: grid;
  gap: 10px;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.workspace-section,
.analysis-section {
  margin-bottom: 22px;
}

.workspace-panel {
  scroll-margin-top: 18px;
  padding: clamp(14px, 2.2vw, 20px);
}

.exam-progress {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--sky);
}

.exam-progress span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.exam-progress strong {
  display: block;
  margin-top: 2px;
}

progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dce6e9;
}

progress::-webkit-progress-bar {
  background: #dce6e9;
}

progress::-webkit-progress-value {
  background: var(--green);
}

.question-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.question-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 88px;
  overflow-y: auto;
  padding: 2px 0 4px;
}

.question-nav-button {
  flex: 0 0 auto;
  width: 38px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--navy);
  font-weight: 900;
}

.question-nav-button.active {
  background: var(--navy);
  color: #ffffff;
}

.question-nav-button.answered:not(.active) {
  border-color: rgba(23, 71, 59, 0.5);
  background: #edf6ef;
  color: var(--green);
}

.question-card {
  min-height: 0;
  padding: clamp(14px, 2.2vw, 20px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.question-card h4 {
  margin: 6px 0 10px;
  font-size: 18px;
  line-height: 1.38;
  letter-spacing: 0;
}

.question-type {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

blockquote {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: var(--paper);
  color: #374151;
  line-height: 1.5;
}

.question-figure {
  margin: 0 0 12px;
}

.question-figure img {
  display: block;
  width: min(100%, 680px);
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.choice-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-weight: 700;
  line-height: 1.42;
}

.choice-option:has(input:checked) {
  border-color: rgba(23, 71, 59, 0.65);
  background: #f4f8f5;
}

.work-upload {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed rgba(23, 71, 59, 0.38);
  border-radius: 8px;
  background: #f7faf8;
}

.work-upload h5 {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
  letter-spacing: 0;
}

.work-upload small,
.upload-current span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
}

.upload-drop {
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--green);
  font-weight: 900;
  text-align: center;
}

.upload-drop input {
  max-width: 100%;
  padding: 9px;
}

.upload-current {
  display: grid;
  gap: 7px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.upload-current strong {
  overflow-wrap: anywhere;
}

.upload-preview {
  width: min(100%, 260px);
  max-height: 180px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.compact-button {
  width: fit-content;
  padding: 9px 11px;
}

.workspace-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--surface) 22%);
}

.submit-button {
  background: var(--rose);
}

.analysis-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.analysis-table-wrap {
  overflow-x: auto;
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.analysis-table th,
.analysis-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.analysis-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .hero-band,
  .exam-grid,
  .status-grid,
  .question-layout {
    grid-template-columns: 1fr;
  }

  .question-nav {
    display: flex;
    flex-wrap: wrap;
  }

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

@media (max-width: 680px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-panel,
  .signup-panel {
    grid-column: 1;
    margin-top: 110px;
  }

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

  .topbar,
  .session-tools,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-grid,
  .exam-progress,
  .workspace-actions,
  .analysis-grid,
  .nav-list {
    grid-template-columns: 1fr;
  }
}
