:root {
  --ink: #17233c;
  --muted: #66758d;
  --line: #dbe7f5;
  --bg: #f6f9ff;
  --panel: #ffffff;
  --blue: #2f6df6;
  --cyan: #16bdd4;
  --green: #20b970;
  --yellow: #ffd166;
  --orange: #ff8a4c;
  --pink: #f45aa7;
  --shadow: 0 18px 44px rgba(47, 109, 246, 0.13);
  --soft-shadow: 0 10px 26px rgba(23, 35, 60, 0.08);
  --top-section-gap: clamp(34px, 3.8vw, 48px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-bottom: 32px;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.62;
  background:
    radial-gradient(circle at 9% 7%, rgba(255, 209, 102, 0.34), transparent 23%),
    radial-gradient(circle at 90% 8%, rgba(22, 189, 212, 0.24), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f4f8ff 48%, #f9fbff 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

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

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: #eef4ff;
  color: var(--blue);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(18px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(219, 231, 245, 0.9);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--cyan), var(--green));
  box-shadow: var(--soft-shadow);
}

.brand strong {
  display: block;
  font-size: 18px;
  color: var(--blue);
}

.brand span:not(.brand-mark),
.muted,
.section-title p:not(.eyebrow),
footer {
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

nav a {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 850;
}

nav a:nth-child(1) {
  background: #eef4ff;
  color: var(--blue);
}

nav a:nth-child(2) {
  background: #eafffd;
  color: #087a88;
}

nav a:nth-child(3) {
  background: #fff7df;
  color: #9a6700;
}

.hero,
.stage-rail,
.flow-toolbar,
.api-strip,
.cockpit,
footer {
  width: min(1240px, calc(100% - 36px));
  margin-left: auto;
  margin-right: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 360px;
  gap: 18px;
  margin-top: 24px;
}

.hero-copy,
.hero-metrics div,
.api-strip,
.console-card,
.stage,
.flow-toolbar,
footer {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 260px;
  padding: clamp(28px, 4vw, 48px);
  color: #fff;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(47, 109, 246, 0.97), rgba(22, 189, 212, 0.94) 55%, rgba(32, 185, 112, 0.94)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: auto, 34px 34px;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: 30px;
  bottom: 26px;
  width: 220px;
  height: 120px;
  border-radius: 24px;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(255, 255, 255, 0.36) 18% 20%, transparent 20% 42%, rgba(255, 255, 255, 0.36) 42% 44%, transparent 44% 68%, rgba(255, 255, 255, 0.36) 68% 70%, transparent 70%),
    linear-gradient(180deg, transparent 0 28%, rgba(255, 255, 255, 0.28) 28% 31%, transparent 31% 62%, rgba(255, 255, 255, 0.28) 62% 65%, transparent 65%);
  opacity: 0.45;
}

.hero .eyebrow {
  color: #fff3b0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.24;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-inline: auto;
  font-size: clamp(34px, 4.4vw, 56px);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.hero-title-keep {
  white-space: nowrap;
}

h2 {
  font-size: clamp(22px, 2.2vw, 30px);
}

h3 {
  font-size: 18px;
}

.hero-copy p:not(.eyebrow) {
  position: relative;
  z-index: 1;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.91);
  font-size: 17px;
}

.hero-metrics {
  display: grid;
  gap: 14px;
}

.hero-metrics div {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  min-height: 76px;
  padding: 18px;
}

.hero-metrics div::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -26px;
  width: 96px;
  height: 96px;
  border-radius: 30px;
  opacity: 0.42;
  transform: rotate(18deg);
}

.hero-metrics div:nth-child(1) {
  background: #eef4ff;
}

.hero-metrics div:nth-child(1)::after {
  background: var(--blue);
}

.hero-metrics div:nth-child(2) {
  background: #fff3ea;
}

.hero-metrics div:nth-child(2)::after {
  background: var(--orange);
}

.hero-metrics div:nth-child(3) {
  background: #edfff7;
}

.hero-metrics div:nth-child(3)::after {
  background: var(--green);
}

.hero-metrics b {
  font-size: 34px;
  color: var(--blue);
  line-height: 1;
}

.hero-metrics span {
  font-weight: 900;
}

.stage-rail {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 0;
}

.stage {
  position: relative;
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 82px;
  padding: 14px 12px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.stage::before {
  content: "";
  position: absolute;
  inset: auto 12px 10px 12px;
  height: 5px;
  border-radius: 999px;
  background: #dbe7f5;
}

.stage:nth-child(1) {
  background: #eef4ff;
}

.stage:nth-child(2) {
  background: #eafffd;
}

.stage:nth-child(3) {
  background: #fff8dc;
}

.stage:nth-child(4) {
  background: #fff0ea;
}

.stage:nth-child(5) {
  background: #fff0f7;
}

.stage:nth-child(6) {
  background: #f3efff;
}

.stage b {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 20px;
}

.stage span {
  display: inline-block;
  min-width: 0;
  margin-top: 0;
  font-weight: 900;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage:hover,
.stage.active {
  transform: translateY(-2px);
  border-color: rgba(47, 109, 246, 0.5);
  box-shadow: 0 16px 34px rgba(47, 109, 246, 0.16);
}

.stage.active::before {
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
}

.stage.complete::before {
  background: linear-gradient(90deg, var(--green), var(--yellow));
}

.flow-toolbar {
  position: static;
  display: grid;
  grid-template-columns: minmax(112px, auto) minmax(0, 1fr) auto minmax(112px, auto);
  gap: 14px;
  align-items: center;
  width: min(1240px, calc(100% - 36px));
  margin: 26px auto 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

#flowPrev {
  grid-column: 1;
  grid-row: 1;
  z-index: 1;
}

#flowNext {
  grid-column: 4;
  grid-row: 1;
  z-index: 1;
}

.page-button {
  min-height: 44px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-weight: 900;
  cursor: pointer;
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.flow-caption {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  min-width: 0;
  pointer-events: none;
  z-index: 0;
}

.flow-caption span {
  display: inline-flex;
  min-width: 72px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #0c5e69;
  background: #eafffd;
  font-weight: 950;
}

.flow-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  z-index: 1;
}

.flow-actions[hidden],
.flow-actions .inline-submit[hidden],
#submitAssessment[hidden] {
  display: none !important;
}

.flow-actions .inline-submit {
  margin-top: 0;
  white-space: nowrap;
}

.api-strip {
  display: block;
  overflow: hidden;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.initial-assessment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.initial-assessment-heading p {
  margin: 5px 0 0;
}

.button.danger {
  border-color: rgba(177, 55, 55, 0.35);
  color: #9a2f2f;
}

.learning-record-panel {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  border-top: 5px solid #7657d5;
}

.learning-record-title p {
  max-width: 720px;
}

.learning-record-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.learning-record-summary article {
  display: grid;
  gap: 5px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid rgba(76, 67, 152, 0.15);
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff, #f7f4ff);
}

.learning-record-summary span,
.learning-record-summary small {
  color: var(--muted);
}

.learning-record-summary strong {
  color: #4c3e9f;
  font-size: 30px;
}

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

.learning-record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
}

.learning-record-grid > section {
  padding: 16px;
  border: 1px solid rgba(51, 93, 131, 0.14);
  border-radius: 16px;
  background: rgba(249, 252, 255, 0.84);
}

.learning-record-grid h3 {
  margin-top: 0;
}

.learning-record-timeline,
.learning-session-history {
  display: grid;
  gap: 10px;
}

.learning-attempt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(60, 93, 135, 0.13);
  border-radius: 14px;
  background: #fff;
}

.learning-attempt-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: #6d57ca;
  font-weight: 900;
}

.learning-attempt-main {
  min-width: 0;
}

.learning-attempt-main strong,
.learning-attempt-main small {
  display: block;
}

.learning-attempt-score {
  text-align: right;
}

.learning-attempt-score strong {
  display: block;
  color: var(--blue);
  font-size: 24px;
}

.learning-attempt-delta.is-up {
  color: #137a53;
}

.learning-attempt-delta.is-down {
  color: #a63434;
}

.learning-session-card {
  padding: 12px 14px;
  border-left: 4px solid #b8addf;
  border-radius: 12px;
  background: #fff;
}

.learning-session-card.is-current {
  border-left-color: #6d57ca;
  background: #f8f5ff;
}

.learning-session-card strong,
.learning-session-card small {
  display: block;
}

.learning-record-dialog {
  width: min(92vw, 560px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 26px 80px rgba(23, 41, 68, 0.3);
}

.learning-record-dialog::backdrop {
  background: rgba(18, 29, 47, 0.56);
  backdrop-filter: blur(4px);
}

.learning-record-dialog-card {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.learning-record-dialog-card label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.learning-record-dialog-card input {
  width: 100%;
}

.export-session-preview {
  padding: 12px 14px;
  border-radius: 12px;
  color: #3f4d62;
  background: #f3f7fc;
}

.learning-record-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 860px) {
  .initial-assessment-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .learning-record-summary,
  .learning-record-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.stage-rail + .api-strip,
.api-strip + .symptom-evidence-control {
  margin-top: var(--top-section-gap);
}

.api-title {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.api-title strong {
  display: block;
  min-width: 0;
  font-size: 20px;
  line-height: 1.24;
  font-weight: 950;
}

.api-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.generation-mode-switch,
.candidate-models {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 16px 0;
  border: 1px solid #d9e7f5;
  border-radius: 14px;
  padding: 12px 14px;
  background: #f8fbff;
}

.api-strip > .generation-mode-switch,
.api-strip > .model-config-panel,
.api-strip > .ensemble-progress {
  grid-column: 2;
}

.generation-mode-switch legend,
.candidate-models legend {
  padding: 0 7px;
  color: #23466f;
  font-weight: 900;
}

.generation-mode-switch label,
.candidate-models label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.model-config-panel[hidden] {
  display: none !important;
}

.enhanced-api-panel {
  display: grid;
  gap: 12px;
}

.enhanced-api-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.fixed-model-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fixed-model-roles span {
  border-radius: 999px;
  padding: 8px 12px;
  color: #174f75;
  background: #eaf6ff;
  font-size: 14px;
}

.ensemble-progress {
  margin-top: 16px;
  border: 1px solid #b9d3ef;
  border-radius: 14px;
  padding: 14px;
  background: #f6fbff;
}

.ensemble-progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #153f70;
}

.api-strip .ensemble-progress-heading {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.api-strip .ensemble-progress.is-dragging .ensemble-progress-heading {
  cursor: grabbing;
}

.ensemble-progress-task {
  display: block;
  min-height: 40px;
  margin-top: 10px;
  color: #234f75;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

.ensemble-progress-heading button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #d6e2ec;
  border-radius: 9px;
  background: #fff;
  color: #60778b;
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
}

.ensemble-progress-heading button[hidden] {
  display: none;
}

.ensemble-progress-percent {
  display: block;
  margin-top: auto;
  color: #12639e;
  font-size: 48px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.ensemble-progress-elapsed {
  display: block;
  margin-top: 6px;
  color: #6c8193;
  font-size: 14px;
  font-weight: 800;
}

.ensemble-progress-track {
  height: 10px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #dce9f6;
}

.ensemble-progress-track span {
  display: block;
  width: 4%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2878c8, #20b970);
  transition: width 220ms ease;
}

.ensemble-progress p {
  margin: 0;
  color: #36546f;
  font-size: 14px;
  line-height: 1.55;
}

.ensemble-progress-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ensemble-progress-task-list {
  display: grid;
  min-height: 0;
  gap: 9px;
  margin-top: 10px;
  overflow-y: auto;
}

.ensemble-progress-task-list[hidden] {
  display: none;
}

.ensemble-progress-task-card {
  border: 1px solid #d3e2ef;
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.ensemble-progress-task-card.is-completed {
  border-color: #a9ddc5;
  background: #f3fcf7;
}

.ensemble-progress-task-card.is-failed {
  border-color: #efb8b8;
  background: #fff7f7;
}

.ensemble-progress-task-card > div:first-child,
.ensemble-progress-task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ensemble-progress-task-card > div:first-child span,
.ensemble-progress-task-meta {
  color: #60788d;
  font-size: 12px;
  font-weight: 750;
}

.ensemble-progress-task-card p {
  margin-top: 5px;
  color: #36546f;
  font-size: 12px;
  line-height: 1.45;
}

.ensemble-progress-task-meta {
  margin-top: 7px;
}

.ensemble-progress-task-track {
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce9f6;
}

.ensemble-progress-task-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2878c8, #20b970);
  transition: width 220ms ease;
}

.ensemble-discussion {
  margin-top: 12px;
  border: 1px solid #d3e2ef;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fbfdff;
}

.ensemble-discussion summary {
  cursor: pointer;
  color: #1d527c;
  font-weight: 900;
}

.ensemble-discussion[open] summary {
  padding-bottom: 9px;
  border-bottom: 1px solid #dce8f2;
}

.ensemble-discussion-body {
  margin-top: 10px;
  color: #334f66;
  font-size: 14px;
  line-height: 1.65;
}

.ensemble-discussion-intro {
  margin: 0 0 12px;
  border-radius: 9px;
  padding: 9px 11px;
  color: #466177;
  background: #f0f7fd;
}

.ensemble-discussion-stage {
  margin-top: 12px;
  border: 1px solid #dce8f2;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
}

.ensemble-discussion-stage h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: #183f5e;
  font-size: 15px;
}

.ensemble-discussion-stage h4 span {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  color: #fff;
  background: #2579c8;
  font-size: 13px;
}

.ensemble-discussion-stage p {
  margin: 5px 0;
}

.ensemble-process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.ensemble-process-card {
  border: 1px solid #e1eaf2;
  border-radius: 9px;
  padding: 9px 10px;
  background: #f8fbfe;
}

.ensemble-process-card h5 {
  margin: 0 0 5px;
  color: #235679;
  font-size: 14px;
}

.ensemble-candidate-output {
  margin-top: 9px;
  border-top: 1px solid #dfe9f2;
  padding-top: 7px;
}

.ensemble-candidate-output summary {
  color: #2a628c;
  font-size: 13px;
  font-weight: 800;
}

.ensemble-candidate-output pre {
  max-height: 360px;
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 7px;
  padding: 9px;
  color: #263f52;
  background: #fff;
  font: inherit;
  line-height: 1.6;
}

.ensemble-timing-stage {
  background: #f7fbff;
}

.ensemble-timing-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px 12px;
  padding-left: 0 !important;
  list-style: none;
}

.ensemble-timing-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed #d9e5ee;
  padding: 4px 0;
}

.ensemble-timing-list b {
  white-space: nowrap;
  color: #1d527c;
}

.ensemble-discussion-notice {
  border-left: 3px solid #e2a52c;
  padding-left: 10px;
  color: #75520e;
}

.ensemble-discussion-body h4 {
  margin: 12px 0 4px;
}

.ensemble-discussion-body ul {
  margin: 4px 0 8px;
  padding-left: 22px;
}

.status-dot {
  width: 12px;
  height: 12px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(32, 185, 112, 0.16);
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
  min-width: 0;
}

.api-grid label {
  min-width: 0;
  justify-items: stretch;
  text-align: center;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 950;
}

.api-grid input {
  min-width: 0;
  font-size: 18px;
  text-align: center;
}

.normal-model-selector {
  min-width: 0;
  margin: 0;
  border: 1px solid #e0e9f2;
  border-radius: 12px;
  background: #f8fbfe;
  padding: 9px 10px 10px;
}

.normal-model-selector legend {
  color: #40576c;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 18px;
  font-weight: 950;
  padding: 0 5px;
}

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

.api-strip .normal-model-options label {
  display: flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #d7e3ef;
  border-radius: 9px;
  background: #fff;
  color: #173b58;
  cursor: pointer;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 16px;
  font-weight: 900;
  padding: 7px 9px;
}

.api-strip .normal-model-options label:has(input:checked) {
  border-color: #8ebbec;
  background: #edf7ff;
  box-shadow: inset 0 0 0 1px rgba(52, 128, 202, 0.08);
}

.api-strip .normal-model-options input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #247bd1;
}

.api-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.api-connection-status {
  flex: 1;
  min-width: 0;
  border: 1px solid #d9e7f5;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted);
  background: #fbfdff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.api-connection-status[data-state="loading"] {
  border-color: #b8cdf8;
  color: #1f4f9f;
  background: #eef4ff;
}

.api-connection-status[data-state="success"] {
  border-color: #9edfc5;
  color: #106c45;
  background: #effcf6;
}

.api-connection-status[data-state="error"] {
  border-color: #f1b9b9;
  color: #9f2525;
  background: #fff3f3;
}

/* Model interface control — one clear surface instead of nested full-width fieldsets. */
.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;
}

.api-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
  border-bottom: 1px solid #dce8f3;
  background: linear-gradient(115deg, #ffffff 0%, #f7fbff 58%, #f2fbf9 100%);
}

.api-title {
  gap: 13px;
}

.api-title-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #2779ed, #19bca4);
  box-shadow: 0 8px 20px rgba(39, 121, 237, 0.2);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.03em;
}

.api-title strong {
  font-size: 21px;
}

.api-title p {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 700;
}

.api-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.api-strip .generation-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 1px solid #d5e3f0;
  border-radius: 14px;
  background: #edf4fa;
}

.api-strip .generation-mode-switch label {
  position: relative;
  display: block;
  cursor: pointer;
}

.api-strip .generation-mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.api-strip .generation-mode-switch label > span {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 6px 14px;
  color: #5b7084;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  text-align: center;
  transition: 160ms ease;
}

.api-strip .generation-mode-switch label > span b {
  color: #29475f;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

.api-strip .generation-mode-switch input:checked + span {
  border-color: #bed5ee;
  color: #32775f;
  background: #fff;
  box-shadow: 0 4px 12px rgba(58, 92, 126, 0.11);
}

.api-strip .generation-mode-switch input:checked + span b {
  color: #12639e;
}

.api-strip .generation-mode-switch input:focus-visible + span {
  outline: 3px solid rgba(39, 121, 237, 0.24);
  outline-offset: 2px;
}

.api-header .button.api-reset-button {
  min-height: 48px;
  border: 1px solid #d7e2ed;
  color: #526b80;
  background: #fff;
  box-shadow: none;
}

.api-config-surface {
  margin: 18px 22px 22px;
  border: 1px solid #dce7f1;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(47, 78, 108, 0.06);
}

.api-section-heading,
.api-subsection-title,
.candidate-models legend {
  display: flex;
  align-items: center;
  gap: 9px;
}

.api-section-heading {
  justify-content: space-between;
  margin-bottom: 15px;
}

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

.api-section-heading span,
.api-subsection-title span,
.candidate-models legend > span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #146da8;
  background: #e7f4ff;
  font-size: 14px;
  font-weight: 950;
}

.api-section-heading strong,
.api-subsection-title b,
.candidate-models legend > b {
  color: #183c59;
  font-size: 18px;
  font-weight: 950;
}

.api-section-heading > small,
.candidate-models legend > small {
  color: #7a8ea0;
  font-size: 14px;
  font-weight: 750;
}

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

.api-strip .enhanced-api-grid {
  grid-template-columns: 1.45fr 1fr 1fr;
}

.api-strip .normal-api-grid {
  grid-template-columns: minmax(240px, 0.9fr) minmax(420px, 2.1fr);
}

.api-strip .api-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  border: 1px solid #e0e9f2;
  border-radius: 12px;
  padding: 11px 12px 12px;
  color: #40576c;
  background: #f8fbfe;
  text-align: left;
  font-size: 15px;
  font-weight: 850;
  transition: 160ms ease;
}

.api-strip .api-field:focus-within {
  border-color: #8ebbec;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(39, 121, 237, 0.09);
}

.api-strip .api-field input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border-color: #d7e3ef;
  border-radius: 9px;
  padding: 0 11px;
  color: #18364f;
  background: #fff;
  font-size: 16px;
  font-weight: 750;
  text-align: left;
}

.api-strip .api-subsection {
  margin: 14px 0 0;
  border: 1px solid #e0e9f2;
  border-radius: 13px;
  padding: 13px;
  background: #fbfdff;
}

.api-strip .candidate-models {
  display: block;
}

.api-strip .candidate-models legend {
  width: auto;
  margin: 0 0 10px;
  padding: 0;
  color: inherit;
}

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

.api-strip .candidate-model-card {
  display: grid;
  grid-template-rows: minmax(54px, auto) auto;
  gap: 9px;
  min-width: 0;
  border: 1px solid #dce7f1;
  border-radius: 11px;
  padding: 11px 12px;
  color: #304b62;
  background: #fff;
  transition: 160ms ease;
}

.api-strip .candidate-model-card:has(input:checked) {
  border-color: #9fc5eb;
  background: #f0f8ff;
  box-shadow: inset 0 0 0 1px rgba(52, 128, 202, 0.07);
}

.api-strip .candidate-model-card:not(:has(input:checked)) {
  opacity: 0.62;
}

.api-strip .candidate-model-card-single {
  grid-template-rows: minmax(54px, 1fr);
}

.api-strip .candidate-model-card label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.api-strip .candidate-model-card input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #247bd1;
}

.api-strip .candidate-model-card label > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.api-strip .candidate-model-card b {
  color: #173b58;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 17px;
  font-weight: 900;
}

.api-strip .candidate-model-card small {
  color: #71869a;
  font-size: 12px;
  font-weight: 750;
}

.api-strip .candidate-model-card select {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid #cfddea;
  border-radius: 9px;
  padding: 0 34px 0 10px;
  color: #173b58;
  background: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  font-weight: 850;
}

.api-strip .candidate-model-card select:focus-visible {
  outline: 3px solid rgba(39, 121, 237, 0.2);
  outline-offset: 2px;
}

.api-strip .candidate-model-card select:disabled {
  cursor: not-allowed;
  color: #8495a5;
  background: #edf2f6;
}

.ensemble-route {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.ensemble-route-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.ensemble-route-flow > span {
  display: grid;
  gap: 3px;
  border-radius: 10px;
  padding: 9px 12px;
  color: #536b80;
  background: #eef6fc;
  text-align: center;
}

.ensemble-route-flow > span:nth-of-type(2) {
  color: #3f5d2b;
  background: #f0f9e9;
}

.ensemble-route-flow > span:nth-of-type(3) {
  color: #6a4a29;
  background: #fff5e8;
}

.ensemble-route-flow small {
  font-size: 13px;
  font-weight: 750;
}

.ensemble-route-flow b {
  color: inherit;
  font-size: 16px;
}

.ensemble-route-flow em {
  color: #6e8293;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.ensemble-route-flow i {
  color: #9aabba;
  font-style: normal;
  font-weight: 900;
}

.api-strip .api-connection-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px;
  margin-top: 15px;
}

.api-strip .api-connection-row .button {
  min-width: 186px;
}

.api-strip .api-connection-status {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 13px;
  font-size: 15px;
}

.api-strip .ensemble-progress {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9500;
  display: flex;
  width: 320px;
  height: 320px;
  flex-direction: column;
  margin: 0;
  border-radius: 22px;
  padding: 18px;
  border-color: #cbddec;
  background: linear-gradient(135deg, #f8fcff, #f4fbf8);
  box-shadow: 0 22px 60px rgba(35, 65, 93, 0.24);
}

.api-strip .ensemble-progress[hidden] {
  display: none;
}

.api-strip .ensemble-progress[data-stage="completed"] {
  border-color: #9fd9bd;
  background: linear-gradient(145deg, #f7fffb, #edf9f3);
}

.api-strip .ensemble-progress[data-stage="failed"] {
  border-color: #efb4b4;
  background: linear-gradient(145deg, #fffafa, #fff3f3);
}

.api-strip .ensemble-progress[data-stage="failed"] .ensemble-progress-percent {
  color: #b53c3c;
}

.api-strip .ensemble-progress .ensemble-progress-track {
  flex: 0 0 auto;
  margin: 14px 0 12px;
}

.api-strip .ensemble-progress > p {
  max-height: 76px;
  overflow: auto;
  font-size: 13px;
}

.api-strip .ensemble-progress-actions {
  max-height: 72px;
  overflow: auto;
}

.api-strip .ensemble-progress-actions .button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}

.api-strip .ensemble-progress.is-multi #ensembleProgressTask,
.api-strip .ensemble-progress.is-multi #ensembleProgressPercent,
.api-strip .ensemble-progress.is-multi #ensembleProgressElapsed,
.api-strip .ensemble-progress.is-multi > .ensemble-progress-track,
.api-strip .ensemble-progress.is-multi > #ensembleProgressDetail {
  display: none;
}

.api-strip .ensemble-progress.is-multi .ensemble-progress-task-list {
  flex: 1 1 auto;
}

@media (max-width: 980px) {
  .api-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .api-header-controls {
    width: 100%;
  }

  .api-strip .generation-mode-switch {
    flex: 1;
  }

  .api-strip .api-grid,
  .api-strip .enhanced-api-grid {
    grid-template-columns: 1fr;
  }

  .candidate-model-grid {
    grid-template-columns: 1fr;
  }

  .ensemble-route {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .api-header,
  .api-config-surface {
    padding: 15px;
  }

  .api-config-surface {
    margin: 12px;
  }

  .api-header-controls,
  .api-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .api-reset-button {
    width: 100%;
  }

  .api-strip .generation-mode-switch {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .ensemble-route-flow {
    grid-template-columns: 1fr;
  }

  .ensemble-route-flow i {
    transform: rotate(90deg);
    text-align: center;
  }

  .api-strip .api-connection-row {
    grid-template-columns: 1fr;
  }

  .api-strip .api-connection-row .button {
    width: 100%;
  }

  .api-strip .ensemble-progress {
    right: 12px;
    bottom: 12px;
    width: min(300px, calc(100vw - 24px));
    height: min(300px, calc(100vw - 24px));
  }
}

.cockpit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  min-height: 520px;
}

.student-pane,
.ai-pane {
  display: contents;
}

.flow-panel {
  display: none;
}

.flow-panel.is-active {
  display: block;
  animation: pageIn 0.34s ease both;
}

#assessment,
#precase,
#precase-answer,
.flow-panel[data-flow-panel="1"],
.flow-panel[data-flow-panel="2"],
.flow-panel[data-flow-panel="3"],
.flow-panel[data-flow-panel="4"] {
  grid-column: 1 / -1;
}

#precase.flow-panel.is-active,
#precase-answer.flow-panel.is-active {
  min-height: 360px;
}

#report.flow-panel.is-active,
.flow-panel[data-flow-panel="4"].is-active {
  min-height: 360px;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.console-card {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2.4vw, 26px);
}

.console-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green), var(--yellow), var(--orange), var(--pink));
}

.section-title {
  margin-bottom: 20px;
}

.section-title.compact {
  margin-bottom: 16px;
}

.row-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.pill {
  padding: 7px 12px;
  border-radius: 999px;
  background: #fff4d6;
  color: #9a6700;
  font-weight: 900;
  white-space: nowrap;
}

.question-block {
  display: grid;
  gap: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 18px;
  margin-top: 18px;
}

.question-block:first-of-type {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  width: 100%;
  margin-bottom: 10px;
  font-weight: 900;
}

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

.scale-list fieldset,
.quiz fieldset {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

#assessment fieldset.has-error {
  border-color: #e65454;
  background: #fff6f6;
  box-shadow: 0 0 0 2px rgba(230, 84, 84, 0.1);
}

.form-feedback {
  min-height: 22px;
  margin: 12px 0 0;
  color: #a52b2b;
  font-weight: 850;
  line-height: 1.5;
}

.quiz {
  display: grid;
  gap: 14px;
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(38px, 1fr));
  gap: 8px;
}

.scale label,
.quiz label {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fbfdff;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.scale label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #eef4ff;
}

.quiz label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.scale label:hover,
.quiz label:hover {
  transform: translateY(-1px);
  border-color: #9fc0ff;
}

.scale label:has(input:checked),
.quiz label:has(input:checked) {
  background: #fff8dc;
  border-color: #ffd166;
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.45);
}

input[type="radio"] {
  accent-color: var(--blue);
}

label {
  display: grid;
  gap: 7px;
  font-weight: 850;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fbfdff;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(47, 109, 246, 0.16);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 10px 16px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.button.primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.button.secondary {
  background: linear-gradient(135deg, var(--orange), var(--pink));
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.button:disabled,
.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  filter: grayscale(0.18);
}

.inline-submit {
  width: fit-content;
  margin-top: 10px;
}

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

.bars.empty {
  display: block;
  color: var(--muted);
}

.metric {
  display: grid;
  grid-template-columns: 116px 1fr 70px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: #fff;
}

.metric span {
  font-weight: 900;
}

.metric b {
  color: var(--blue);
  text-align: right;
}

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

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
}

.meter.clinical i {
  background: linear-gradient(90deg, var(--orange), var(--yellow), var(--green));
}

.score-dashboard,
.dimension-panel {
  display: grid;
  gap: 16px;
}

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

.score-tile {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(23, 35, 60, 0.07);
}

.score-tile::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -30px;
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: rgba(75, 123, 236, 0.18);
  transform: rotate(18deg);
}

.score-tile.main {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.score-tile:nth-child(2)::after {
  background: rgba(34, 197, 94, 0.18);
}

.score-tile:nth-child(3)::after {
  background: rgba(255, 209, 102, 0.34);
}

.score-tile:nth-child(4)::after {
  background: rgba(255, 107, 203, 0.18);
}

.score-tile span,
.score-tile small {
  display: block;
  position: relative;
  z-index: 1;
}

.score-tile span {
  color: var(--muted);
  font-weight: 900;
}

.score-tile.main span,
.score-tile.main small,
.score-tile.main em {
  color: rgba(255, 255, 255, 0.88);
}

.score-tile b {
  position: relative;
  z-index: 1;
  color: var(--blue);
  font-size: 44px;
  line-height: 1;
}

.score-tile.main b {
  color: #fff;
}

.score-tile em {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-style: normal;
}

.score-tile small {
  margin-top: 8px;
  color: #15803d;
  font-weight: 900;
}

.dimension-panel {
  display: grid;
  justify-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.dimension-radar-frame {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 12px 28px rgba(23, 35, 60, 0.07);
}

.dimension-radar-frame .dimension-panel {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.radar-frame-panel {
  min-width: 0;
}

.dimension-details-panel {
  display: grid;
  gap: 14px;
}

.dimension-heading {
  display: grid;
  gap: 8px;
}

.dimension-heading strong {
  color: var(--ink);
  font-size: 18px;
}

.dimension-heading > span {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.clinical-summary-list {
  display: grid;
  gap: 8px;
  justify-self: stretch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  text-align: left;
}

.clinical-summary-score {
  color: #42526e;
  font-weight: 850;
}

.clinical-summary-list ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 1.35em;
}

.clinical-summary-list li {
  padding-left: 2px;
}

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

.radar-chart {
  display: grid;
  grid-template-columns: minmax(320px, 1fr);
  gap: 12px;
  align-items: center;
  justify-items: center;
  min-width: 0;
  width: 100%;
}

.radar-visual {
  display: grid;
  min-width: 0;
  place-items: center;
}

.radar-visual svg {
  width: min(100%, 820px);
  aspect-ratio: 1;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.radar-grid-ring {
  fill: rgba(47, 109, 246, 0.018);
  stroke: #adc3df;
  stroke-width: 2.3;
  vector-effect: non-scaling-stroke;
}

.radar-axis-line {
  stroke: #b6c9e3;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.radar-area {
  fill-opacity: 0.18;
  stroke: url(#radar-area-stroke);
  stroke-width: 0;
}

.clinical-score-radar .radar-area {
  fill-opacity: 0.24;
}

.radar-line {
  fill: none;
  stroke: var(--blue);
  stroke-linejoin: miter;
  stroke-width: 5.4;
  vector-effect: non-scaling-stroke;
}

.clinical-score-radar .radar-line {
  stroke: var(--green);
}

.radar-point {
  fill: #fff;
  stroke: var(--radar-color, var(--blue));
  stroke-width: 4.4;
  vector-effect: non-scaling-stroke;
}

.radar-axis-label {
  fill: var(--radar-color, var(--ink));
  font-size: 50px;
  font-weight: 950;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-linejoin: round;
  stroke-width: 5px;
}

.radar-axis-score {
  fill: var(--radar-color, var(--blue));
  font-size: 30px;
  font-weight: 950;
  dominant-baseline: central;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-linejoin: round;
  stroke-width: 5px;
}

.radar-axis-line {
  stroke: var(--radar-color, #d6e1f0);
  opacity: 0.32;
}

.radar-score-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.radar-score-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  min-height: 68px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--radar-color, var(--blue));
  border-radius: 14px;
  background: #ffffff;
  padding: 12px 14px;
  box-shadow: 0 10px 22px rgba(23, 32, 51, 0.06);
}

.radar-score-card::after {
  position: absolute;
  inset: 0 0 auto auto;
  width: 76px;
  height: 76px;
  border-radius: 0 14px 0 76px;
  background: var(--radar-color, var(--blue));
  content: "";
  opacity: 0.08;
}

.radar-color-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--radar-color, var(--blue));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--radar-color, var(--blue)) 18%, transparent);
}

.radar-score-list span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-score-list b {
  color: var(--radar-color, var(--blue));
  font-size: 22px;
  line-height: 1;
}

.radar-score-list em,
.radar-score-list small {
  color: var(--muted);
  font-size: 16px;
  font-style: normal;
  font-weight: 850;
}

.radar-value-bar {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3fb;
}

.radar-value-bar i {
  display: block;
  width: var(--radar-score, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--radar-color, var(--blue)), color-mix(in srgb, var(--radar-color, var(--blue)) 52%, #ffffff));
}

.radar-score-list small {
  grid-column: 1 / -1;
}

.score-row {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid #e4ecf6;
  border-radius: 14px;
  background: #fff;
}

.score-row span {
  font-weight: 900;
}

.score-row b {
  color: var(--blue);
  text-align: right;
}

.score-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.score-row.needs-work b {
  color: #f97316;
}

.score-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef8;
}

.score-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
}

.score-meter.clinical i {
  background: linear-gradient(90deg, var(--orange), var(--yellow), var(--green));
}

.personalization-note {
  padding: 13px 14px;
  border: 1px dashed #b8cdf8;
  border-radius: 14px;
  background: #eef4ff;
  color: var(--muted);
}

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

.relation-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #bee7df;
  border-radius: 16px;
  background: linear-gradient(135deg, #effffb, #ffffff);
}

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

.relation-heading strong {
  color: #087a61;
  font-size: 18px;
}

.relation-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

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

.relation-grid div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid #d7f3ee;
  border-radius: 14px;
  background: #fff;
}

.relation-grid span,
.relation-grid b {
  display: block;
}

.relation-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.relation-grid b {
  margin-top: 6px;
  color: #087a61;
  font-size: 18px;
}

.relation-stack {
  display: grid;
  gap: 10px;
}

.relation-stack p {
  padding: 11px 12px;
  border: 1px solid #d7f3ee;
  border-radius: 12px;
  background: #fff;
  line-height: 1.75;
}

.relation-card p {
  margin: 0;
  color: #2f455f;
}

.relation-card p strong {
  color: #087a61;
}

.report-overview {
  display: grid;
  gap: 16px;
  color: #102a55;
}

.report-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #c9d9f2;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
}

.platform-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #0e3c91, #2f6df6);
  font-size: 24px;
  font-weight: 950;
}

.report-head strong,
.report-head span {
  display: block;
}

.report-head strong {
  color: #0b3580;
  font-size: 18px;
}

.report-head span,
.report-code {
  color: #526783;
  font-size: 13px;
}

.report-code {
  justify-self: end;
  white-space: nowrap;
}

.report-title {
  position: relative;
  padding-bottom: 14px;
  color: #102a55;
  text-align: center;
  font-family: "SimSun", "Songti SC", "Microsoft YaHei", serif;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 950;
  letter-spacing: 0.08em;
}

.report-title::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #2f6df6, transparent);
}

.learner-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  padding: 16px 18px;
  border: 1px solid #c9d9f2;
  border-radius: 16px;
  background: #f8fbff;
  font-weight: 850;
}

.learner-info span {
  min-width: 0;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid #d5e1f2;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.score-card {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 142px;
  padding: 18px 12px;
  border-right: 1px solid #d5e1f2;
}

.score-card:last-child {
  border-right: 0;
}

.score-card span {
  color: #17233c;
  font-weight: 900;
}

.score-card b {
  color: #173f95;
  font-size: 42px;
  line-height: 1;
}

.score-card em {
  color: #657187;
  font-style: normal;
}

.score-card i {
  color: #f4ad14;
  font-style: normal;
  font-size: 22px;
  letter-spacing: 2px;
}

.score-card small {
  color: #159947;
  font-weight: 900;
}

.report-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.report-section {
  border: 1px solid #d5e1f2;
  border-radius: 16px;
  padding: 16px 18px;
  background: #ffffff;
}

.report-section h3 {
  display: inline-flex;
  margin: -16px 0 14px -18px;
  padding: 9px 18px;
  border-radius: 16px 0 16px 0;
  color: #fff;
  background: linear-gradient(135deg, #173f95, #2f6df6);
  font-size: 17px;
}

.ability-section,
.recommend-section {
  grid-column: 1 / -1;
}

.ability-table {
  display: grid;
  gap: 0;
}

.ability-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(180px, 1fr) 82px;
  gap: 16px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #e5edf7;
}

.ability-row:last-child {
  border-bottom: 0;
}

.ability-row strong,
.ability-row span {
  display: block;
}

.ability-row strong {
  color: #102a55;
  font-size: 16px;
}

.ability-row span {
  margin-top: 3px;
  color: #66758d;
  font-size: 13px;
}

.ability-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eff7;
}

.ability-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6df6, #20b970);
}

.ability-row.is-alert .ability-meter i {
  background: linear-gradient(90deg, #ff8a4c, #ffd166);
}

.ability-row b {
  color: #159947;
  font-size: 22px;
  text-align: right;
}

.ability-row.is-alert b {
  color: #f97316;
}

.ability-row em {
  color: #66758d;
  font-size: 13px;
  font-style: normal;
}

.legend {
  margin: 10px 0 0;
  color: #66758d;
  text-align: center;
  font-size: 13px;
}

.issue-section ol,
.advice-section ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
}

.issue-section li,
.advice-section li {
  padding-bottom: 10px;
  color: #26384f;
  border-bottom: 1px dashed #cbd7e7;
  line-height: 1.7;
}

.issue-section li::marker {
  color: #ef4444;
  font-weight: 950;
}

.advice-section li::marker {
  color: #20b970;
  font-weight: 950;
}

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

.case-recommend-grid div {
  position: relative;
  min-height: 98px;
  padding: 14px;
  border: 1px solid #d5e1f2;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.case-recommend-grid div::after {
  content: "推荐";
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 10px;
  border-radius: 0 14px 0 12px;
  color: #fff;
  background: #20b970;
  font-size: 12px;
  font-weight: 900;
}

.case-recommend-grid div:nth-child(even)::after {
  background: #ff8a4c;
}

.case-recommend-grid strong,
.case-recommend-grid span {
  display: block;
}

.case-recommend-grid strong {
  color: #173f95;
}

.case-recommend-grid span {
  margin-top: 8px;
  color: #66758d;
  font-size: 13px;
}

.evidence-section {
  grid-column: 1 / -1;
}

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

.evidence-grid div {
  min-height: 112px;
  padding: 14px;
  border: 1px solid #d5e1f2;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.evidence-grid strong,
.evidence-grid span {
  display: block;
}

.evidence-grid strong {
  color: #173f95;
}

.evidence-grid span {
  margin-top: 8px;
  color: #66758d;
  font-size: 13px;
  line-height: 1.65;
}

hr {
  height: 1px;
  border: 0;
  margin: 18px 0;
  background: var(--line);
}

.output {
  min-height: 240px;
  max-height: none;
  overflow: visible;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  font: 15px/1.75 "Microsoft YaHei", Arial, sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.case-output {
  border-left: 8px solid var(--orange);
  padding: 22px 24px;
  font-size: 16px;
  line-height: 2;
  white-space: pre-wrap;
  background:
    linear-gradient(180deg, #fff, #fffaf6);
}

.case-basis {
  margin-bottom: 14px;
  border: 1px solid #ffe0b8;
  border-left: 8px solid var(--yellow);
  border-radius: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff9e8, #ffffff);
  color: #5f4a13;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.case-basis.empty {
  color: var(--muted);
  border-left-color: #cbd5e1;
  background: #f8fbff;
}

.profile-output {
  border-left: 8px solid var(--pink);
}

.reference-output {
  min-height: 150px;
  margin-top: 14px;
  border-left: 8px solid var(--green);
  background: linear-gradient(180deg, #f1fff8, #ffffff);
}

.report-output {
  max-height: min(68vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 20px;
  scrollbar-gutter: stable;
}

.report-output::-webkit-scrollbar {
  width: 10px;
}

.report-output::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #eef4ff;
}

.report-output::-webkit-scrollbar-thumb {
  border: 2px solid #eef4ff;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
}

.output[data-state="loading"] {
  background: #eef4ff;
  border-color: #b8cdf8;
}

.output[data-state="error"] {
  color: #8d2424;
  background: #fff4f4;
  border-color: #efb4b4;
}

.api-output-strong {
  font-weight: 800;
  color: var(--ink);
}

.answer-box {
  margin-top: 14px;
}

.analysis-box {
  display: grid;
  gap: 16px;
  align-items: start;
  border: 1px solid #ffd4c7;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #fff0ea, #ffffff);
}

#precase-answer .analysis-box {
  grid-template-columns: 1fr;
}

#precase-answer .answer-box {
  margin-top: 0;
}

.pre-answer-box {
  display: grid;
  gap: 14px;
}

.case-question-answer-list {
  display: grid;
  gap: 11px;
}

.professional-literacy-scale,
.knowledge-card-grid,
.teaching-goal-output,
.teaching-goal-record {
  display: grid;
  gap: 12px;
}

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

.literacy-item,
.knowledge-extraction-card,
.professional-literacy-post,
.teaching-goal-record-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.literacy-item:last-child {
  grid-column: 1 / -1;
}

.literacy-response-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 132px;
  gap: 12px;
  align-items: end;
}

.literacy-response-row input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
}

.literacy-response-row input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
}

.literacy-anchors {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.knowledge-extraction-card {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  border-color: #b9d8ff;
  background: linear-gradient(180deg, #f7fbff, #ffffff);
}

.knowledge-extraction-card h3,
.knowledge-extraction-card p,
.professional-literacy-post h3,
.professional-literacy-post p,
.teaching-goal-record-section h3,
.teaching-goal-record-section p {
  margin: 0;
}

.knowledge-extraction-card p,
.professional-literacy-post p,
.teaching-goal-record-section p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

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

.knowledge-card-field:last-child {
  grid-column: 1 / -1;
}

.knowledge-card-field textarea {
  min-height: 72px;
  resize: vertical;
}

.knowledge-card-grid.is-disabled {
  opacity: 0.68;
}

.professional-literacy-post {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  border-color: #d8c8ff;
  background: linear-gradient(180deg, #fcfaff, #ffffff);
}

.teaching-goal-output {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.teaching-goal-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid #c9d9ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(23, 35, 60, 0.06);
}

.teaching-goal-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 5px;
  align-items: baseline;
}

.teaching-goal-card-head > strong {
  color: var(--ink);
  font-size: 17px;
}

.teaching-goal-card-head > b {
  color: var(--blue);
  font-size: 30px;
}

.teaching-goal-card-head > span {
  color: var(--muted);
  font-size: 13px;
}

.teaching-goal-dimensions {
  display: grid;
  gap: 7px;
}

.teaching-goal-dimensions span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.teaching-goal-dimensions b {
  color: #42526e;
}

.teaching-goal-record-section {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  border-color: rgba(118, 87, 213, 0.24);
}

.teaching-goal-record.empty {
  color: var(--muted);
}

.teaching-goal-record-card {
  padding: 14px;
  border: 1px solid rgba(51, 93, 131, 0.14);
  border-radius: 14px;
  background: #fff;
}

.teaching-goal-record-card > div:first-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  gap: 12px;
  align-items: baseline;
}

.teaching-goal-record-card strong {
  color: var(--ink);
}

.teaching-goal-record-card b {
  color: var(--blue);
}

.teaching-goal-record-card small {
  color: var(--muted);
}

.teaching-goal-record-dimensions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.teaching-goal-record-dimensions span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* 教学目标 v2：五级量表、总分优先和可折叠明细。 */
.professional-literacy-block {
  position: relative;
  overflow: hidden;
  border-color: rgba(47, 109, 246, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(22, 189, 212, 0.11), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 20px 50px rgba(39, 83, 141, 0.08);
}

.feature-section-heading {
  display: grid;
  gap: 6px;
}

.feature-section-heading h3,
.feature-section-heading p {
  margin: 0;
}

.feature-section-heading h3 {
  color: #132f54;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.feature-section-heading p {
  color: #62748d;
  font-size: 14px;
  line-height: 1.7;
}

.professional-literacy-scale {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.literacy-level-guide {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(47, 109, 246, 0.14);
  border-radius: 16px;
  padding: 10px;
  background: rgba(239, 246, 255, 0.78);
}

.literacy-level-guide span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  color: #60738f;
  font-size: 12px;
}

.literacy-level-guide b {
  color: #1f5fd1;
  font-size: 13px;
}

.literacy-level-guide small {
  color: #71829a;
  font-weight: 800;
}

.literacy-item {
  min-width: 0;
  margin: 0;
  border: 1px solid #dce8f6;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.literacy-item:last-child {
  grid-column: 1 / -1;
}

.literacy-item:focus-within {
  border-color: rgba(47, 109, 246, 0.46);
  box-shadow: 0 14px 34px rgba(47, 109, 246, 0.1);
}

.literacy-item.has-error {
  border-color: #e66f78;
  box-shadow: 0 0 0 3px rgba(230, 111, 120, 0.12);
}

.literacy-item legend {
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  color: var(--ink);
  font-size: inherit;
  font-weight: 900;
  line-height: 1.5;
}

.literacy-item legend > span {
  display: inline-grid;
  width: 30px;
  height: 30px;
  margin-right: 9px;
  place-items: center;
  border-radius: 10px;
  color: #1f5fd1;
  background: #eaf3ff;
  font-size: 12px;
  font-weight: 950;
  vertical-align: middle;
}

.literacy-item legend > b {
  margin-right: 8px;
  color: #0e7490;
  font-weight: 950;
}

.literacy-level-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 18px;
}

.literacy-level-options label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.literacy-level-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.literacy-level-option {
  position: relative;
  display: grid;
  min-height: 84px;
  place-content: center;
  gap: 2px;
  border: 1px solid #d9e5f2;
  border-radius: 15px;
  padding: 10px 7px;
  color: #314a6b;
  background: #fbfdff;
  text-align: center;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.literacy-level-option b {
  font-size: 15px;
}

.literacy-level-option small {
  color: #1f6feb;
  font-size: 12px;
  font-weight: 900;
}

.literacy-level-option em {
  margin-top: 3px;
  color: #71829a;
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
}

.literacy-level-options label:hover .literacy-level-option {
  transform: translateY(-2px);
  border-color: #91b9f4;
  box-shadow: 0 8px 18px rgba(47, 109, 246, 0.09);
}

.literacy-level-options input:focus-visible + .literacy-level-option {
  outline: 3px solid rgba(47, 109, 246, 0.28);
  outline-offset: 2px;
}

.literacy-level-options input:checked + .literacy-level-option {
  transform: translateY(-2px);
  border-color: #2f6df6;
  color: #123f82;
  background: linear-gradient(145deg, #e9f3ff, #f3fffd);
  box-shadow: 0 10px 24px rgba(47, 109, 246, 0.16), inset 0 0 0 1px rgba(47, 109, 246, 0.12);
}

.literacy-level-options input:checked + .literacy-level-option::after {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
  content: "";
}

.knowledge-extraction-card {
  gap: 16px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(47, 109, 246, 0.18);
  border-radius: 22px;
  padding: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(22, 189, 212, 0.1), transparent 32%),
    linear-gradient(180deg, #f7fbff, #ffffff);
  box-shadow: 0 16px 38px rgba(39, 83, 141, 0.08);
}

.knowledge-card-grid {
  gap: 11px;
}

.knowledge-card-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid #e1ebf5;
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.88);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.knowledge-card-field:focus-within {
  border-color: #8cb8f4;
  box-shadow: 0 8px 20px rgba(47, 109, 246, 0.09);
}

.knowledge-card-field > span {
  color: #274568;
  font-size: 13px;
  font-weight: 950;
}

.knowledge-card-field textarea {
  border-color: transparent;
  border-radius: 11px;
  padding: 10px 11px;
  background: #f7faff;
}

.professional-literacy-post {
  gap: 16px;
  margin-top: 18px;
  border: 1px solid rgba(118, 87, 213, 0.2);
  border-radius: 22px;
  padding: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(118, 87, 213, 0.1), transparent 32%),
    linear-gradient(180deg, #fcfaff, #ffffff);
  box-shadow: 0 16px 38px rgba(77, 55, 133, 0.08);
}

.teaching-goal-output {
  gap: 14px;
  margin-top: 16px;
}

.teaching-goal-card[data-goal-key="knowledge"],
.teaching-goal-record-card[data-goal-key="knowledge"] {
  --goal-accent: #2f6df6;
  --goal-soft: #edf4ff;
}

.teaching-goal-card[data-goal-key="ability"],
.teaching-goal-record-card[data-goal-key="ability"] {
  --goal-accent: #0891b2;
  --goal-soft: #eafcff;
}

.teaching-goal-card[data-goal-key="literacy"],
.teaching-goal-record-card[data-goal-key="literacy"] {
  --goal-accent: #7657d5;
  --goal-soft: #f2efff;
}

.teaching-goal-card[data-goal-key="personalized"],
.teaching-goal-record-card[data-goal-key="personalized"] {
  --goal-accent: #e97836;
  --goal-soft: #fff3ea;
}

.teaching-goal-card {
  display: block;
  overflow: hidden;
  border: 1px solid #dce7f3;
  border-top: 3px solid var(--goal-accent, #2f6df6);
  border-radius: 20px;
  padding: 0;
  background: #fff;
  box-shadow: 0 14px 34px rgba(28, 63, 105, 0.09);
}

.teaching-goal-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 22px;
  gap: 12px;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(145deg, var(--goal-soft, #edf4ff), #ffffff 62%);
}

.teaching-goal-card-head::-webkit-details-marker,
.teaching-goal-record-card > summary::-webkit-details-marker {
  display: none;
}

.teaching-goal-card-title {
  display: grid;
  gap: 3px;
}

.teaching-goal-card-title strong {
  color: var(--ink);
  font-size: 17px;
}

.teaching-goal-card-title small {
  color: #75859b;
  font-size: 12px;
  font-weight: 750;
}

.teaching-goal-card-score {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.teaching-goal-card-score b {
  color: var(--goal-accent, #2f6df6);
  font-size: 32px;
  line-height: 1;
}

.teaching-goal-card-score small {
  color: #7a899e;
  font-size: 12px;
  font-weight: 850;
}

.teaching-goal-card-head svg,
.teaching-goal-record-card > summary svg {
  width: 22px;
  height: 22px;
  color: var(--goal-accent, #2f6df6);
  transition: transform 180ms ease;
}

.teaching-goal-card-head svg path,
.teaching-goal-record-card > summary svg path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.teaching-goal-card[open] .teaching-goal-card-head svg,
.teaching-goal-record-card[open] > summary svg {
  transform: rotate(180deg);
}

.teaching-goal-card-head:focus-visible,
.teaching-goal-record-card > summary:focus-visible {
  outline: 3px solid rgba(47, 109, 246, 0.28);
  outline-offset: -3px;
}

.teaching-goal-dimensions {
  gap: 11px;
  border-top: 1px solid #e5edf6;
  padding: 15px 16px 17px;
  background: #fff;
}

.teaching-goal-dimension-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  color: #5e718c;
  font-size: 13px;
}

.teaching-goal-dimension-row b {
  color: #274568;
}

.teaching-goal-dimension-row > i {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.teaching-goal-dimension-row > i > span {
  display: block;
  width: var(--goal-score, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--goal-accent, #2f6df6), #22c7b8);
}

.teaching-goal-record-section {
  gap: 16px;
  margin-top: 20px;
  border: 1px solid rgba(47, 109, 246, 0.16);
  border-radius: 24px;
  padding: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(22, 189, 212, 0.09), transparent 34%),
    linear-gradient(180deg, #f8fbff, #ffffff);
  box-shadow: 0 18px 44px rgba(39, 83, 141, 0.09);
}

.teaching-goal-record-card {
  overflow: hidden;
  border: 1px solid #dce7f3;
  border-left: 4px solid var(--goal-accent, #2f6df6);
  border-radius: 18px;
  padding: 0;
  background: #fff;
  box-shadow: 0 10px 28px rgba(32, 70, 116, 0.07);
}

.teaching-goal-record-card > summary {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(68px, auto)) 22px;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(145deg, var(--goal-soft, #edf4ff), #ffffff 64%);
}

.teaching-goal-record-title {
  display: grid;
  gap: 3px;
}

.teaching-goal-record-title strong {
  color: var(--ink);
  font-size: 17px;
}

.teaching-goal-record-title small {
  color: #74849a;
  font-size: 12px;
  font-weight: 750;
}

.teaching-goal-record-total {
  display: grid;
  gap: 2px;
  text-align: right;
}

.teaching-goal-record-total small {
  color: #7a899e;
  font-size: 11px;
  font-weight: 800;
}

.teaching-goal-record-total b {
  color: #274568;
  font-size: 17px;
}

.teaching-goal-record-total.is-gain b {
  color: var(--goal-accent, #2f6df6);
}

.teaching-goal-record-dimensions {
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0;
  border-top: 1px solid #e5edf6;
  padding: 8px 18px 14px;
  color: #5f718b;
  font-size: 13px;
}

.teaching-goal-record-dimension-head,
.teaching-goal-record-dimension-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) repeat(3, 72px);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}

.teaching-goal-record-dimension-head {
  color: #8492a5;
  font-size: 11px;
  font-weight: 900;
}

.teaching-goal-record-dimension-head span:not(:first-child),
.teaching-goal-record-dimension-row b {
  text-align: right;
}

.teaching-goal-record-dimension-row {
  border-top: 1px solid #edf2f7;
}

.teaching-goal-record-dimension-row > span {
  color: #50647f;
  font-weight: 750;
}

.teaching-goal-record-dimension-row b {
  color: #274568;
}

.case-question-answer {
  display: grid;
  gap: 7px;
}

.case-question-answer span {
  color: var(--ink);
  font-weight: 900;
  line-height: 1.55;
}

.case-question-answer textarea {
  min-height: clamp(86px, 10vh, 102px);
  background: #fff;
}

#submitPreAnswer,
#submitPostAnswer {
  justify-self: end;
}

.case-score-output {
  margin-top: 14px;
}

.score-comparison-output {
  margin-top: 14px;
}

.score-comparison-card {
  display: grid;
  gap: 12px;
  border: 1px solid #b8cdf8;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #eef4ff, #ffffff);
}

.score-comparison-heading {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.score-comparison-heading > div {
  display: grid;
  gap: 4px;
  border: 1px solid #d9e7f5;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  text-align: center;
}

.score-comparison-heading span,
.score-comparison-card small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.5;
}

.score-comparison-heading strong {
  color: var(--blue);
  font-size: 28px;
}

.score-comparison-card p {
  margin: 0;
  color: var(--ink);
}

.case-keyword-score-note,
.case-score-rule {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.case-score-card {
  display: grid;
  gap: 14px;
  border: 1px solid #bdebd8;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #f2fff8, #ffffff);
  box-shadow: 0 10px 22px rgba(23, 35, 60, 0.06);
}

.case-score-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: baseline;
}

.case-score-head h2,
.case-score-item b {
  color: var(--ink);
  font-weight: 950;
}

.case-score-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.case-score-head strong {
  color: var(--green);
  font-size: 34px;
  line-height: 1;
}

.case-score-head em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

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

.case-score-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #d9e7f5;
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
}

.case-score-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.case-score-item small {
  display: block;
  margin-top: 6px;
  color: #42526e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.case-score-item strong {
  color: var(--blue);
  font-size: 24px;
}

.case-score-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.analysis-box p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
}

textarea {
  min-height: 160px;
  resize: vertical;
}

#report .button {
  width: fit-content;
  margin: 10px 0 14px;
}

#report .row-title .button {
  margin: 0;
}

footer {
  margin-top: 18px;
  margin-bottom: 32px;
  padding: 18px;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer {
  width: auto;
  margin: 18px 0 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--blue);
  text-decoration: underline;
}

.ai-tutor {
  position: fixed;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  right: 22px;
  top: 128px;
  z-index: 90;
  width: min(420px, calc(100vw - 32px));
  min-width: 360px;
  min-height: 360px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  border: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 252, 255, 0.94));
  box-shadow: 0 24px 70px rgba(47, 109, 246, 0.22);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.ai-tutor-head {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 107, 107, 0.22), transparent 36%),
    linear-gradient(135deg, rgba(47, 109, 246, 0.13), rgba(22, 189, 212, 0.12));
  perspective: 900px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.ai-tutor.is-dragging .ai-tutor-head {
  cursor: grabbing;
}

.ai-tutor-head h2 {
  margin: 1px 0 3px;
  font-size: 20px;
}

.ai-tutor-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.ai-tutor-head span::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #96a5b8;
  content: "";
}

.ai-tutor-avatar {
  position: relative;
  display: grid;
  width: 82px;
  height: 86px;
  place-items: center;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 72%, rgba(47, 109, 246, 0.16), transparent 43%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.16));
  transform: rotateX(7deg) rotateY(-12deg);
  transform-style: preserve-3d;
  animation: tutorFloat 4.2s ease-in-out infinite;
  pointer-events: none;
}

.ai-tutor-avatar::before {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 13px;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(23, 35, 60, 0.24), transparent 72%);
  filter: blur(3px);
  content: "";
  transform: translateZ(-20px) rotateX(72deg);
}

.ai-tutor-avatar::after {
  position: absolute;
  inset: 8px 4px 18px;
  border: 2px solid rgba(47, 109, 246, 0.24);
  border-radius: 999px;
  content: "";
  transform: translateZ(-10px) rotateX(68deg);
  animation: tutorIdle 2.6s ease-in-out infinite;
}

.ai-tutor-avatar img {
  position: relative;
  z-index: 2;
  width: 92px;
  height: 92px;
  border-radius: 0;
  filter: drop-shadow(0 8px 10px rgba(47, 109, 246, 0.18));
  object-position: center;
  object-fit: contain;
  transform: translateY(-4px) translateZ(18px) scale(1.18);
}

.ai-tutor-minimize {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.76);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.ai-tutor-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-tutor-head-button {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid rgba(47, 109, 246, 0.18);
  border-radius: 10px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.ai-tutor-body {
  display: grid;
  grid-template-rows: minmax(120px, 1fr) auto auto auto;
  flex: 1;
  gap: 12px;
  min-height: 0;
  padding: 0 16px 16px;
  margin-top: 0;
}

.ai-tutor-messages {
  display: grid;
  min-height: 120px;
  max-height: none;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.ai-tutor-message {
  width: fit-content;
  max-width: 100%;
  border-radius: 15px;
  padding: 10px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: #eef6ff;
  font-size: 14px;
  line-height: 1.65;
}

.ai-tutor-message.user {
  justify-self: end;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.ai-tutor-message.assistant {
  border: 0;
  padding: 0 2px;
  background: transparent;
}

.ai-tutor-input {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.ai-tutor-input-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-tutor-input textarea {
  min-height: 82px;
  max-height: 150px;
  resize: vertical;
}

.ai-tutor-send {
  width: 100%;
}

.ai-tutor-attachment-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ai-tutor-attach {
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid rgba(47, 109, 246, 0.18);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 5px 14px rgba(47, 109, 246, 0.08);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ai-tutor-attach:hover {
  border-color: rgba(47, 109, 246, 0.42);
  box-shadow: 0 7px 18px rgba(47, 109, 246, 0.14);
  transform: translateY(-1px);
}

.ai-tutor-attach:focus-visible,
.ai-tutor-web-switch:has(input:focus-visible) {
  outline: 3px solid rgba(47, 109, 246, 0.2);
  outline-offset: 2px;
}

.ai-tutor-web-switch {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 7px;
  border: 1px solid rgba(47, 109, 246, 0.16);
  border-radius: 999px;
  color: #66758f;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 5px 14px rgba(47, 109, 246, 0.07);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.ai-tutor-web-switch > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.ai-tutor-web-switch-track {
  position: relative;
  width: 30px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cbd6e6;
  box-shadow: inset 0 1px 3px rgba(35, 58, 94, 0.18);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.ai-tutor-web-switch-track > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(29, 55, 91, 0.28);
  transition: transform 180ms ease;
}

.ai-tutor-web-switch:has(input:checked) {
  border-color: rgba(47, 109, 246, 0.32);
  color: var(--blue);
  background: rgba(238, 246, 255, 0.94);
  box-shadow: 0 7px 18px rgba(47, 109, 246, 0.13);
}

.ai-tutor-web-switch input:checked + .ai-tutor-web-switch-track {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 4px 10px rgba(47, 109, 246, 0.25);
}

.ai-tutor-web-switch input:checked + .ai-tutor-web-switch-track > span {
  transform: translateX(12px);
}

.ai-tutor-attachments {
  display: flex;
  max-height: 124px;
  flex-wrap: wrap;
  gap: 8px;
  overflow-y: auto;
}

.ai-tutor-attachment {
  position: relative;
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  padding: 5px 8px 5px 5px;
  border: 1px solid rgba(47, 109, 246, 0.18);
  border-radius: 10px;
  background: rgba(238, 246, 255, 0.9);
  color: var(--ink);
  font-size: 12px;
}

.ai-tutor-attachment img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
}

.ai-tutor-attachment-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-tutor-attachment-remove { border: 0; background: transparent; color: var(--pink); font-size: 18px; line-height: 1; cursor: pointer; }
.ai-tutor-resize-handle { position: absolute; right: 4px; bottom: 4px; width: 20px; height: 20px; cursor: nwse-resize; touch-action: none; }
.ai-tutor-resize-handle::after { position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px; border-right: 2px solid rgba(47, 109, 246, 0.45); border-bottom: 2px solid rgba(47, 109, 246, 0.45); content: ""; }

.ai-tutor[data-state="active"] {
  box-shadow: 0 24px 78px rgba(255, 107, 107, 0.28);
}

.ai-tutor[data-state="active"] .ai-tutor-head span {
  color: var(--pink);
}

.ai-tutor[data-state="active"] .ai-tutor-head span::before {
  background: var(--pink);
  box-shadow: 0 0 0 6px rgba(255, 74, 161, 0.13);
}

.ai-tutor[data-state="active"] .ai-tutor-avatar::after {
  border-color: rgba(255, 107, 107, 0.55);
  animation: tutorActive 1.05s ease-in-out infinite;
}

.ai-tutor[data-state="active"] .ai-tutor-avatar {
  animation: tutorFloatActive 1.6s ease-in-out infinite;
}

.ai-tutor.is-closed {
  width: 142px;
  height: auto !important;
  min-height: 0;
  max-height: none;
  border-radius: 32px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  backdrop-filter: none;
}

.ai-tutor.is-closed .ai-tutor-head {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 32px;
  background: transparent;
  cursor: grab;
}

.ai-tutor.is-closed .ai-tutor-head > div:not(.ai-tutor-avatar),
.ai-tutor.is-closed .ai-tutor-head-actions,
.ai-tutor.is-closed .ai-tutor-body {
  display: none;
}

.ai-tutor.is-closed .ai-tutor-resize-handle { display: none; }

.shared-qwen-api-panel { margin-bottom: 14px; }

.ai-tutor.is-closed .ai-tutor-avatar {
  width: 122px;
  height: 138px;
  overflow: visible;
  background: transparent;
  border-radius: 0;
}

.ai-tutor.is-closed .ai-tutor-avatar::before,
.ai-tutor.is-closed .ai-tutor-avatar::after {
  display: none;
}

.ai-tutor.is-closed .ai-tutor-avatar img {
  width: 154px;
  height: 154px;
  filter: drop-shadow(0 14px 16px rgba(47, 109, 246, 0.16));
  object-fit: contain;
  object-position: center;
  transform: translateY(-14px) translateZ(34px) scale(1.08);
  -webkit-mask-image: none;
  mask-image: none;
}

.ai-tutor:not(.is-closed) .ai-tutor-avatar {
  overflow: visible;
  margin: 0;
  border-radius: 0;
  background: transparent;
}

.ai-tutor:not(.is-closed) .ai-tutor-avatar::before {
  display: none;
}

.ai-tutor:not(.is-closed) .ai-tutor-avatar::after {
  display: none;
}

.ai-tutor:not(.is-closed) .ai-tutor-avatar img {
  filter: drop-shadow(0 8px 10px rgba(47, 109, 246, 0.12));
}

@keyframes tutorIdle {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.03);
  }
}

@keyframes tutorFloat {
  0%,
  100% {
    transform: translateY(0) rotateX(7deg) rotateY(-12deg);
  }
  50% {
    transform: translateY(-6px) rotateX(9deg) rotateY(-6deg);
  }
}

@keyframes tutorFloatActive {
  0%,
  100% {
    transform: translateY(-2px) rotateX(8deg) rotateY(-10deg) scale(1);
  }
  50% {
    transform: translateY(-10px) rotateX(12deg) rotateY(6deg) scale(1.04);
  }
}

@keyframes tutorActive {
  0%,
  100% {
    opacity: 0.65;
    transform: rotate(0deg) scale(1);
  }
  50% {
    opacity: 1;
    transform: rotate(4deg) scale(1.08);
  }
}

@media (max-width: 1120px) {
  .hero,
  .api-strip,
  .cockpit {
    grid-template-columns: 1fr;
  }

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

  .bars,
  .radar-chart,
  .dimension-radar-frame,
  .scale-list,
  .analysis-box,
  .score-summary-grid,
  .dimension-score-grid,
  .case-score-grid,
  .relation-grid,
  .learner-info,
  .score-grid,
  .report-lower {
    grid-template-columns: 1fr;
  }

  .score-card {
    border-right: 0;
    border-bottom: 1px solid #d5e1f2;
  }

  .score-card:last-child {
    border-bottom: 0;
  }

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

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

@media (max-width: 880px) {
  .professional-literacy-scale,
  .teaching-goal-output {
    grid-template-columns: 1fr;
  }

  .literacy-item:last-child {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .knowledge-card-grid,
  .teaching-goal-record-dimensions {
    grid-template-columns: 1fr;
  }

  .knowledge-card-field:last-child {
    grid-column: auto;
  }

  .literacy-response-row {
    grid-template-columns: 1fr;
  }

  .literacy-anchors {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .teaching-goal-record-card > div:first-child {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 980px) {
  .api-strip {
    grid-template-columns: 1fr;
  }

  .api-strip > .generation-mode-switch,
  .api-strip > .model-config-panel,
  .api-strip > .ensemble-progress {
    grid-column: 1;
  }

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

  .enhanced-api-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar,
  .row-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .api-grid,
  .stage-rail,
  .flow-toolbar {
    grid-template-columns: 1fr;
  }

  .learning-record-summary,
  .learning-record-grid {
    grid-template-columns: 1fr;
  }

  .learning-record-dialog-actions .button {
    width: 100%;
  }

  .api-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .score-comparison-heading {
    grid-template-columns: 1fr;
  }

  #flowPrev,
  #flowNext,
  .flow-caption,
  .flow-actions {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
  }

  .flow-caption {
    order: 2;
  }

  .flow-actions {
    justify-content: stretch;
    order: 3;
  }

  .flow-actions .button,
  .page-button {
    width: 100%;
  }

  .hero,
  .stage-rail,
  .flow-toolbar,
  .api-strip,
  .cockpit,
  footer {
    width: min(100% - 24px, 1240px);
  }

  h1 {
    font-size: 31px;
  }

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

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

  .metric b {
    text-align: left;
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  .radar-score-list li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .radar-score-list em {
    grid-column: 1 / -1;
  }

  .score-row b {
    text-align: left;
  }

  .report-head,
  .ability-row,
  .case-recommend-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .report-code,
  .ability-row b {
    justify-self: start;
    text-align: left;
  }

  .report-title {
    text-align: left;
    letter-spacing: 0;
  }

  .report-title::after {
    left: 0;
    right: 45%;
  }

  .ai-tutor {
    right: 12px;
    top: auto;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .ai-tutor-head {
    grid-template-columns: 96px 1fr 34px;
  }

  .ai-tutor-body {
    padding-left: 16px;
    margin-top: 0;
  }

  .ai-tutor.is-closed {
    width: 132px;
  }

}

/* 病例作答：宽屏并排对照，窄屏通过病例速览保持上下文。 */
.post-case-workspace {
  display: grid;
  gap: 18px;
  align-items: stretch;
}

.post-case-reading,
.post-case-answering {
  min-width: 0;
}

.post-case-answering,
.post-case-answering .analysis-box,
.post-case-answering .answer-box {
  height: 100%;
}

.post-case-answering .analysis-box {
  padding: 14px;
}

.ensemble-discussion-compact {
  display: grid;
  gap: 8px;
}

.ensemble-discussion-compact p {
  margin: 0;
}

.case-peek-button {
  position: sticky;
  z-index: 8;
  top: 12px;
  width: fit-content;
  margin: 0 0 12px auto;
  border: 1px solid #9fc4f7;
  border-radius: 999px;
  padding: 9px 16px;
  color: #123f82;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(30, 93, 173, 0.18);
  font: 800 15px/1.2 "Microsoft YaHei", Arial, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.case-peek-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.case-peek-button:focus-visible,
.case-peek-close:focus-visible {
  outline: 3px solid rgba(32, 112, 224, 0.34);
  outline-offset: 3px;
}

.case-peek-dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: min(82vh, 820px);
  margin: auto;
  border: 0;
  border-radius: 22px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 80px rgba(17, 47, 91, 0.28);
}

.case-peek-dialog::backdrop {
  background: rgba(13, 34, 67, 0.52);
  backdrop-filter: blur(4px);
}

.case-peek-surface {
  display: grid;
  max-height: min(82vh, 820px);
  grid-template-rows: auto minmax(0, 1fr);
}

.case-peek-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
  background: linear-gradient(135deg, #eef6ff, #fff9f3);
}

.case-peek-heading h2 {
  margin: 0;
  font-size: 20px;
}

.case-peek-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #bed1ec;
  border-radius: 50%;
  padding: 0;
  color: #244b7b;
  background: #fff;
  font: 700 26px/1 Arial, sans-serif;
  cursor: pointer;
}

.case-peek-content {
  min-height: 260px;
  margin: 0;
  overflow: auto;
  padding: 22px;
  color: var(--ink);
  background: #fff;
  font: 16px/1.9 "Microsoft YaHei", Arial, sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ensemble-review-list > li {
  margin-bottom: 14px;
}

.ensemble-review-list p {
  margin: 6px 0 0;
}

@media (min-width: 1121px) {
  #precase.flow-panel.is-active {
    grid-column: 1;
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  #precase-answer.flow-panel.is-active {
    grid-column: 2;
  }

  .post-case-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .post-case-reading {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow: auto;
  }

  .case-peek-button {
    display: none;
  }
}

@media (max-width: 1120px) {
  .case-peek-dialog {
    margin: auto 12px 12px;
  }

  .case-peek-surface {
    max-height: min(78vh, 720px);
  }
}

@media (max-width: 720px) {
  .literacy-level-guide {
    gap: 4px;
    padding: 8px 6px;
  }

  .literacy-level-guide span {
    flex-direction: column;
    gap: 0;
  }

  .literacy-item legend {
    margin: 0 0 10px;
    padding: 0;
    font-size: 14px;
  }

  .literacy-level-options {
    gap: 5px;
    padding: 0 10px 14px;
  }

  .literacy-level-option {
    min-height: 62px;
    border-radius: 12px;
    padding: 8px 3px;
  }

  .literacy-level-option b {
    font-size: 13px;
  }

  .literacy-level-option small {
    font-size: 10px;
  }

  .literacy-level-option em {
    display: none;
  }

  .professional-literacy-post,
  .knowledge-extraction-card,
  .teaching-goal-record-section {
    border-radius: 18px;
    padding: 14px;
  }

  .teaching-goal-record-card > summary {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 22px;
    gap: 10px 8px;
    padding: 14px;
  }

  .teaching-goal-record-title {
    grid-column: 1 / 4;
  }

  .teaching-goal-record-card > summary svg {
    grid-column: 4;
    grid-row: 1;
  }

  .teaching-goal-record-total {
    border-top: 1px solid rgba(91, 119, 154, 0.14);
    padding-top: 9px;
    text-align: left;
  }

  .teaching-goal-record-dimensions {
    padding: 6px 14px 12px;
  }

  .teaching-goal-record-dimension-head,
  .teaching-goal-record-dimension-row {
    grid-template-columns: minmax(104px, 1fr) repeat(3, 45px);
    gap: 6px;
    font-size: 11px;
  }
}
