:root {
  --bg: #f8fafc;
  --ink: #111827;
  --muted: #5b6472;
  --line: #dbe3ef;
  --panel: #ffffff;
  --soft: #f1f5f9;
  --brand: #2563eb;
  --brand-deep: #1d4ed8;
  --ai: #8b5cf6;
  --motion: #14b8a6;
  --warn: #f59e0b;
  --success: #22c55e;
  --gold: #d97706;
  --pipe: #0891b2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.wrap {
  width: 1260px;
  margin: 20px auto 40px;
}

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

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 23px;
  font-weight: 900;
}

.brand-name,
.brand-tagline {
  display: block;
  text-align: left;
}

.brand-name {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 900;
}

.brand-tagline {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-action,
.ghost-action {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 15px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.primary-action:hover {
  background: var(--brand-deep);
}

.ghost-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.app-layout {
  display: grid;
  grid-template-columns: 230px 1000px;
  gap: 24px;
  align-items: start;
}

.sidebar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 12px;
  min-height: 500px;
  max-height: calc(100vh - 40px);
  position: sticky;
  top: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

.sidebar:hover::-webkit-scrollbar-thumb {
  background: #94a3b8;
}

.tree-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tree-folder {
  margin: 14px 0 6px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 900;
}

.tree-subfolder {
  margin: 8px 0 5px 14px;
  color: var(--muted);
  font: 800 12px/1.35 "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.tree-node {
  margin: 4px 0;
}

.tree-node summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 7px;
  min-height: 28px;
  padding: 3px 6px;
  cursor: pointer;
  user-select: none;
  white-space: normal;
}

.tree-node summary::-webkit-details-marker {
  display: none;
}

.tree-node summary::before {
  content: "▸";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  transform: translateY(-1px);
  transition: transform 0.16s ease;
}

.tree-node[open] > summary::before {
  transform: rotate(90deg) translateX(1px);
}

.tree-node > summary.tree-folder {
  margin: 12px 0 6px;
}

.tree-node > summary.tree-subfolder {
  margin: 6px 0 4px 0;
}

.tree-children {
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.tree-item {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: none;
  outline: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 7px 8px;
  text-align: left;
  font: 800 12px/1.35 "Noto Sans SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  box-shadow: none;
  text-shadow: none;
  -webkit-font-smoothing: auto;
  font-synthesis: none;
}

.tree-item.indent {
  padding-left: 12px;
}

.tree-item.active {
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.tree-static {
  cursor: default;
  color: var(--muted);
  font-weight: 700;
}

.workspace {
  width: 1000px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

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

.json-animation-controls .control {
  min-height: 38px;
}

.json-animation-controls .control label {
  width: 88px;
}

.json-animation-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.home-card-badge {
  align-self: flex-start;
  display: inline-flex;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid #99f6e4;
  background: #ecfeff;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
}

.analysis-step {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.analysis-step:first-of-type {
  margin-top: 6px;
  padding-top: 0;
  border-top: 0;
}

.analysis-step h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

details.analysis-step {
  padding-bottom: 2px;
}

.analysis-step-summary {
  display: flex;
  align-items: center;
  min-height: 42px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  cursor: pointer;
  list-style-position: inside;
}

details.analysis-step[open] .analysis-step-summary {
  margin-bottom: 10px;
}

.analysis-step-content {
  padding: 0 2px 4px 20px;
}

.analysis-step-content > p:first-child {
  margin-top: 0;
}

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

.control label {
  width: 96px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.control input[type="range"] {
  flex: 1;
  min-width: 80px;
  accent-color: var(--motion);
}

.value {
  width: 54px;
  text-align: right;
  color: var(--brand);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

button.action {
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

button.action:hover {
  background: var(--brand-deep);
}

button.sound-action {
  border: 1px solid #99f6e4;
  background: #ffffff;
  color: #0f766e;
}

button.sound-action:hover {
  background: #ecfeff;
}

button.sound-action[aria-pressed="true"] {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

button.sound-action[aria-pressed="true"]:hover {
  background: #115e59;
}

button.sound-action:disabled {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--muted);
  cursor: not-allowed;
}

#canvas-holder {
  width: min(100%, 1000px);
  aspect-ratio: 2 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

#canvas-holder canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.home-panel {
  display: none;
  width: 1000px;
  background: transparent;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  align-items: stretch;
  min-height: 280px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(37, 99, 235, 0.08);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.home-hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  line-height: 1.22;
  font-weight: 800;
  color: var(--ink);
}

.home-hero p {
  max-width: 560px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
  font-weight: 400;
}

.hero-copy {
  align-self: center;
}

.hero-lab {
  position: relative;
  min-height: 210px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    #eef6ff;
  background-size: 28px 28px;
}

.lab-orbit {
  position: absolute;
  inset: 24px;
  border-bottom: 3px solid rgba(20, 184, 166, 0.9);
  border-left: 3px solid rgba(37, 99, 235, 0.9);
}

.lab-orbit::before {
  content: "";
  position: absolute;
  left: 32px;
  bottom: 24px;
  width: 210px;
  height: 110px;
  border-top: 4px solid var(--ai);
  border-radius: 100% 100% 0 0;
  transform: rotate(-10deg);
}

.lab-orbit span:first-child,
.lab-orbit span:last-child {
  position: absolute;
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--warn);
}

.lab-orbit span:first-child {
  left: 72px;
  bottom: 116px;
}

.lab-orbit span:last-child {
  right: 42px;
  bottom: 20px;
  background: var(--success);
}

.lab-panel {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
}

.lab-panel strong {
  grid-column: 1 / -1;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.lab-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
}

.home-section {
  padding: 30px 0 0;
}

.home-section.compact {
  padding-top: 24px;
}

.home-section h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink);
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 2px;
}

.chapter-grid,
.recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.home-card {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.home-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.home-card.home-static {
  cursor: default;
}

.home-card.home-static:hover {
  border-color: var(--line);
  background: #fff;
}

.home-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 700;
}

.home-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
  font-weight: 500;
}

.home-card.is-featured {
  position: relative;
  min-height: 132px;
  padding-top: 18px;
}

.favorite-home-card {
  position: relative;
  padding-right: 48px;
}

.favorite-home-mark {
  position: absolute;
  top: 14px;
  right: 16px;
  color: #e11d48;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.card-icon {
  width: 34px;
  margin-bottom: 14px;
  color: var(--brand);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
}

.chapter-card,
.feature-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.chapter-card {
  min-height: 112px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

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

.chapter-card strong {
  margin-bottom: 12px;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
}

.chapter-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  font-weight: 500;
}

.chapter-card::before {
  content: "";
  display: block;
  width: 34px;
  height: 4px;
  border-radius: 999px;
  margin-bottom: 18px;
  background: var(--brand);
}

.tone-teal::before { background: var(--motion); }
.tone-amber::before { background: var(--warn); }
.tone-purple::before { background: var(--ai); }
.tone-green::before { background: var(--success); }
.is-muted { color: var(--muted); cursor: default; }

.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.feature-card h3 {
  margin: 0 0 10px;
  line-height: 1.45;
  font-weight: 800;
}

.feature-card p:not(.eyebrow) {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
  font-weight: 400;
}

.lab-card {
  border-color: rgba(20, 184, 166, 0.35);
}

.progress-card {
  border-color: rgba(139, 92, 246, 0.28);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stats-grid span {
  display: block;
  min-height: 72px;
  border-radius: 8px;
  background: var(--soft);
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}

.stats-grid strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
}

.problem-notes {
  display: none;
  width: 1000px;
  margin-top: 18px;
}

#problemNotesHost {
  width: 1000px;
}

.problem-load-status {
  width: 100%;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.problem-load-status.is-error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c;
}

.problem-notes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.problem-note-block {
  position: relative;
  grid-column: 1;
  padding: 18px 20px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  overflow: visible;
}

.problem-note-block:last-child {
  background: #fff;
}

.problem-note-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.problem-note-block h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: 0;
}

.problem-note-block.has-favorite .problem-note-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.favorite-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #fff1f2;
  color: #e11d48;
  padding: 0;
  font: inherit;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(225, 29, 72, 0.12);
  transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.favorite-toggle:hover {
  background: #ffe4e6;
  box-shadow: 0 10px 24px rgba(225, 29, 72, 0.18);
  transform: translateY(-1px);
}

.favorite-toggle.is-favorite {
  background: #e11d48;
  color: #fff;
}

.problem-note-block p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.problem-options {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.problem-note-block .problem-option {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.problem-note-block strong {
  color: var(--ink);
  font-weight: 900;
}

.problem-image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.problem-image-figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.problem-image-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.problem-image-figure figcaption {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  border-top: 1px solid var(--line);
}

.note-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.note-body {
  display: block;
}

.problem-note-block.is-collapsed .note-body {
  display: none;
}

.step-ai-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
}

.step-conversation {
  display: block;
  width: 100%;
  margin: 12px 0 18px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.step-conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #172554;
  font-size: 15px;
}

.step-conversation-clear {
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.step-conversation-history {
  display: flex;
  max-height: 360px;
  min-height: 74px;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.step-conversation-empty {
  margin: auto 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.step-conversation-message {
  width: fit-content;
  max-width: 88%;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 9px 11px;
  overflow-wrap: anywhere;
}

.step-conversation-message.is-user {
  align-self: flex-end;
  border-color: #bfdbfe;
  background: #dbeafe;
}

.step-conversation-message.is-assistant {
  align-self: flex-start;
  border-color: #ddd6fe;
  background: #faf5ff;
}

.step-conversation-role {
  display: block;
  margin-bottom: 4px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.step-conversation-content {
  color: #1e293b;
  font-size: 15px;
  line-height: 1.75;
}

.step-conversation-content p,
.step-conversation-content ul {
  margin: 0 0 8px;
}

.step-conversation-content p:last-child,
.step-conversation-content ul:last-child {
  margin-bottom: 0;
}

.step-conversation-content .step-ai-subtitle {
  color: #312e81;
  font-weight: 900;
}

.step-conversation-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.step-conversation-input {
  width: 100%;
  min-height: 46px;
  resize: vertical;
  border: 1px solid #94a3b8;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
}

.step-conversation-input:focus {
  border-color: #2563eb;
  outline: 3px solid rgba(37, 99, 235, 0.14);
}

.step-conversation-voice,
.step-conversation-send {
  min-height: 46px;
  border: 1px solid #2563eb;
  border-radius: 7px;
  padding: 0 13px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.step-conversation-voice {
  background: #fff;
  color: #1d4ed8;
}

.step-conversation-voice.is-listening {
  border-color: #dc2626;
  background: #fef2f2;
  color: #b91c1c;
}

.step-conversation-send {
  background: #1d4ed8;
  color: #fff;
}

.step-conversation button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.step-conversation-status {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.step-conversation-status.is-error {
  color: #b91c1c;
}

.model-source {
  display: none;
  width: 1000px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px 18px;
}

.model-source h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: 0;
}

.model-source p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.formula-line {
  display: inline-block;
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.note {
  width: 1000px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.summer-exam-panel {
  width: 1000px;
  max-width: 100%;
}

.summer-exam-header {
  border: 1px solid var(--line);
  border-top: 5px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  padding: 30px 32px;
}

.summer-exam-header h1 {
  margin: 5px 0 10px;
  font-size: 32px;
  line-height: 1.25;
}

.summer-exam-header > p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.summer-exam-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.summer-exam-meta span,
.summer-exam-section-heading > span {
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
}

.summer-exam-section {
  margin-top: 22px;
}

.summer-exam-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.summer-exam-section-heading h2 {
  margin: 3px 0 0;
  font-size: 25px;
  line-height: 1.3;
}

.summer-exam-rule {
  margin: 8px 2px 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.summer-exam-question-list {
  display: grid;
  gap: 14px;
}

.summer-exam-question {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px 24px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.summer-exam-question.is-correct {
  border-color: #86efac;
  box-shadow: inset 4px 0 #16a34a;
}

.summer-exam-question.is-incorrect {
  border-color: #fca5a5;
  box-shadow: inset 4px 0 #dc2626;
}

.summer-exam-question.is-unanswered {
  border-color: #fcd34d;
  box-shadow: inset 4px 0 #d97706;
}

.summer-exam-question-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.summer-exam-question-number {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.summer-exam-chapter {
  border-radius: 6px;
  background: var(--soft);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
}

.summer-exam-prompt {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.9;
}

.summer-exam-prompt p {
  margin: 0 0 8px;
}

.summer-exam-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.summer-exam-option {
  display: grid;
  grid-template-columns: 20px 24px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 12px;
  color: #273244;
  font-size: 16px;
  line-height: 1.65;
  cursor: pointer;
}

.summer-exam-option:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.summer-exam-option:has(input:checked) {
  border-color: var(--brand);
  background: #eff6ff;
}

.summer-exam-option input {
  width: 17px;
  height: 17px;
  margin: 4px 0 0;
  accent-color: var(--brand);
}

.summer-exam-option-key {
  color: var(--ink);
}

.summer-exam-option.is-correct-answer {
  border-color: #4ade80;
  background: #f0fdf4;
}

.summer-exam-option.is-wrong-selection {
  border-color: #f87171;
  background: #fef2f2;
}

.summer-exam-feedback {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  color: #374151;
  font-size: 15px;
  line-height: 1.8;
}

.summer-exam-verdict {
  margin: 0 0 7px;
  font-weight: 900;
}

.is-correct .summer-exam-verdict {
  color: #15803d;
}

.is-incorrect .summer-exam-verdict {
  color: #b91c1c;
}

.is-unanswered .summer-exam-verdict {
  color: #b45309;
}

.summer-exam-answer,
.summer-exam-explanation {
  margin: 5px 0 0;
}

.summer-exam-result {
  margin-top: 18px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  padding: 22px 24px;
}

.summer-exam-result.is-stale {
  border-color: #fbbf24;
  background: #fffbeb;
}

.summer-exam-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: #1e3a8a;
  font-weight: 900;
}

.summer-exam-score strong {
  font-size: 42px;
  line-height: 1;
}

.summer-exam-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.summer-exam-result-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.8);
  padding: 11px 12px;
}

.summer-exam-result-grid span,
.summer-exam-result > p {
  color: #475569;
}

.summer-exam-result > p {
  margin: 14px 0 0;
  font-weight: 800;
}

.summer-exam-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

@media (max-width: 1280px) {
  .wrap {
    width: min(100% - 32px, 1060px);
  }

  .app-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .workspace,
  .home-panel,
  .summer-exam-panel,
  #problemNotesHost,
  .problem-notes,
  .model-source,
  .note,
  #canvas-holder {
    width: 100%;
  }

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

  .json-animation-controls .control label {
    flex: 0 0 132px;
    width: 132px;
  }
}

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

  .sidebar {
    position: static;
    min-height: 0;
    max-height: 240px;
  }

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

@media (max-width: 900px) {
  .brand-bar,
  .app-layout,
  .home-hero,
  .split,
  .problem-notes-grid {
    grid-template-columns: 1fr;
  }

  .brand-bar {
    display: grid;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .chapter-grid,
  .recommend-grid,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-hero {
    padding: 24px;
  }

  .home-hero h1 {
    font-size: 34px;
  }

  .summer-exam-header {
    padding: 24px;
  }

  .step-conversation-composer {
    grid-template-columns: 1fr 1fr;
  }

  .step-conversation-input {
    grid-column: 1 / -1;
  }

}

@media (max-width: 700px) {
  .controls,
  .json-animation-controls {
    grid-template-columns: 1fr;
  }

  .summer-exam-options,
  .summer-exam-result-grid {
    grid-template-columns: 1fr;
  }

  .summer-exam-header,
  .summer-exam-question,
  .summer-exam-result {
    padding: 20px 16px;
  }

  .summer-exam-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .summer-exam-actions {
    justify-content: stretch;
  }

  .summer-exam-actions button {
    flex: 1;
  }
}
