* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #172026;
  background: #f5f7f8;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid #1e675f;
  background: #1e675f;
  color: white;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid #c8d3d0;
  border-radius: 6px;
  padding: 8px 10px;
}

.app {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: #ffffff;
  border-bottom: 1px solid #d9e2df;
}

.topbar p {
  margin: 0 0 4px;
  color: #5b6b66;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #5b6b66;
}

.ghost {
  background: #ffffff;
  color: #1e675f;
}

.stage {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px;
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.stage-head h2 {
  margin: 0;
  font-size: 22px;
}

.choice-grid {
  display: grid;
  gap: 16px;
}

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

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

.choice-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.choice-grid.one {
  grid-template-columns: minmax(260px, 520px);
}

.choice,
.part-tile {
  min-height: 116px;
  background: #ffffff;
  color: #172026;
  border-color: #d9e2df;
  text-align: left;
  display: grid;
  align-content: center;
  gap: 8px;
}

.choice:hover,
.part-tile:hover {
  border-color: #1e675f;
  background: #edf5f3;
}

.choice strong,
.part-tile strong {
  font-size: 20px;
}

.choice span,
.part-tile span,
.course-panel p {
  color: #5b6b66;
}

.project-choice {
  min-height: 148px;
}

.diagnostic-choice {
  min-height: 150px;
}

.part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.part-tile {
  min-height: 92px;
}

.workspace {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  padding: 16px;
}

.course-panel,
.work-panel {
  background: #ffffff;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  padding: 16px;
}

.course-panel h2,
.work-panel h2 {
  margin: 14px 0 10px;
}

.session-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e3ebe8;
  margin-top: 16px;
  padding-top: 16px;
}

.session-meta strong {
  color: #1e675f;
}

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

.section-head h2 {
  margin: 0;
}

.voice {
  line-height: 1.8;
  color: #25343a;
}

.designer-panel,
.step-thinking {
  margin-top: 16px;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  background: #f7faf9;
  padding: 12px;
}

.designer-panel h3 {
  margin: 0 0 8px;
}

.designer-panel ol {
  padding-left: 20px;
  max-height: 240px;
  overflow: auto;
}

.designer-panel li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.step-thinking p {
  margin: 6px 0;
  line-height: 1.7;
}

.intro-panel {
  display: grid;
  gap: 16px;
}

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

.intro-grid article,
.knowledge-box {
  border: 1px solid #d9e2df;
  border-radius: 8px;
  background: #f7faf9;
  padding: 12px;
}

.intro-grid h3,
.knowledge-box h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.intro-grid p,
.knowledge-box p,
.knowledge-box li {
  line-height: 1.7;
}

.target-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.target-item {
  min-height: 82px;
  background: #ffffff;
  color: #172026;
  border-color: #d9e2df;
  display: grid;
  gap: 6px;
  text-align: left;
}

.target-item.active {
  border-color: #1e675f;
  background: #edf5f3;
}

.target-item.active strong {
  color: #1e675f;
}

.target-item span,
.path-note {
  color: #5b6b66;
}

.listen-state {
  margin-top: 16px;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  background: #f7faf9;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.listen-state.active {
  border-color: #1e675f;
  background: #edf5f3;
}

.listen-state strong {
  color: #1e675f;
}

.listen-state span {
  color: #5b6b66;
}

.operation-row {
  margin: 18px 0;
}

.manual-box {
  margin-top: 16px;
  border-top: 1px solid #e3ebe8;
  padding-top: 12px;
}

.manual-box summary {
  cursor: pointer;
  color: #1e675f;
  margin-bottom: 12px;
}

.manual-box input,
.manual-box textarea {
  margin-bottom: 8px;
}

.feedback {
  color: #8a3b12;
  font-weight: 600;
}

.diagnostic-workspace {
  grid-template-columns: 380px 1fr;
}

.field-label {
  display: block;
  margin: 14px 0 6px;
  color: #25343a;
  font-weight: 700;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: #25343a;
  line-height: 1.5;
}

.inline-check input {
  width: auto;
  flex: 0 0 auto;
}

.diagnostic-note,
.form-hint {
  margin-top: 12px;
  border: 1px solid #d9e2df;
  border-radius: 6px;
  background: #f7faf9;
  color: #5b6b66;
  line-height: 1.6;
  padding: 10px;
}

.form-hint {
  background: #fff6ee;
  border-color: #e2b995;
  color: #8a3b12;
}

.action-stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.status-pill {
  border: 1px solid #1e675f;
  border-radius: 999px;
  color: #1e675f;
  padding: 4px 10px;
  font-weight: 700;
}

.diagnostic-result,
.diagnostic-empty {
  border: 1px solid #d9e2df;
  border-radius: 8px;
  background: #f7faf9;
  padding: 12px;
}

.diagnostic-progress {
  display: grid;
  gap: 14px;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  background: #f7faf9;
  padding: 14px;
  margin-bottom: 14px;
}

.progress-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.progress-summary strong {
  font-size: 18px;
}

.progress-summary p {
  margin: 6px 0 0;
  color: #5b6b66;
  line-height: 1.6;
}

.progress-summary span {
  white-space: nowrap;
  color: #1e675f;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ebe8;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: #1e675f;
  transition: width 0.25s ease;
}

.progress-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.progress-stats span,
.current-unit span {
  border: 1px solid #d9e2df;
  border-radius: 999px;
  background: #ffffff;
  color: #1e675f;
  font-weight: 700;
  padding: 4px 10px;
}

.current-unit {
  display: grid;
  gap: 8px;
  border: 1px solid #c7d8d3;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.current-unit p {
  margin: 0;
  color: #25343a;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.progress-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #e3ebe8;
  border-radius: 8px;
  background: #ffffff;
}

.progress-steps li > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef3f1;
  color: #5b6b66;
  font-weight: 700;
}

.progress-steps li strong {
  display: block;
  margin-bottom: 4px;
}

.progress-steps li p {
  margin: 0;
  color: #5b6b66;
  line-height: 1.5;
}

.progress-steps li.active {
  border-color: #1e675f;
  background: #edf5f3;
}

.progress-steps li.active > span,
.progress-steps li.done > span {
  background: #1e675f;
  color: #ffffff;
}

.progress-steps li.failed {
  border-color: #b35c21;
  background: #fff6ee;
}

.progress-steps li.failed > span {
  background: #b35c21;
  color: #ffffff;
}

.diagnostic-result h3,
.diagnostic-empty h3 {
  margin: 18px 0 10px;
}

.diagnostic-result p,
.diagnostic-empty p {
  line-height: 1.7;
}

.diagnostic-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #d9e2df;
  padding-bottom: 12px;
}

.diagnostic-overview > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.diagnostic-overview > div:first-child span {
  overflow-wrap: anywhere;
}

.diagnostic-result-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.diagnostic-result-stats span,
.result-panel-head > span {
  border: 1px solid #c7d8d3;
  border-radius: 999px;
  background: #ffffff;
  color: #1e675f;
  font-weight: 700;
  padding: 4px 10px;
  white-space: nowrap;
}

.diagnostic-result-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #c7d8d3;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 14px;
}

.diagnostic-result-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #44544f;
  padding: 8px 12px;
}

.diagnostic-result-tabs button + button {
  border-left: 1px solid #c7d8d3;
}

.diagnostic-result-tabs button.active {
  background: #1e675f;
  color: #ffffff;
}

.diagnostic-result-panel {
  padding-top: 16px;
}

.diagnostic-result-panel > h3:first-child,
.diagnostic-report > h2:first-child,
.diagnostic-report > h3:first-child {
  margin-top: 0;
}

.diagnostic-report {
  max-width: 920px;
  color: #24322f;
}

.diagnostic-report h2 {
  margin: 0 0 18px;
  color: #172622;
  font-size: 24px;
}

.diagnostic-report h3 {
  margin: 24px 0 10px;
  border-bottom: 1px solid #d9e2df;
  padding-bottom: 8px;
  color: #172622;
  font-size: 19px;
}

.diagnostic-report h4 {
  margin: 18px 0 8px;
  color: #25343a;
  font-size: 16px;
}

.diagnostic-report p,
.diagnostic-report li {
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.diagnostic-report p {
  margin: 8px 0;
}

.diagnostic-report ul {
  display: grid;
  gap: 8px;
  margin: 8px 0 16px;
  padding-left: 22px;
}

.result-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.result-panel-head h3 {
  margin: 0 0 5px;
}

.result-panel-head p {
  margin: 0;
  color: #5b6b66;
}

.retrieval-candidate-list {
  display: grid;
  gap: 0;
  border-top: 1px solid #d9e2df;
}

.retrieval-candidate {
  display: grid;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid #d9e2df;
}

.retrieval-candidate > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.retrieval-candidate > header > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.retrieval-candidate > header span,
.candidate-meta span,
.candidate-evidence figcaption span {
  color: #5b6b66;
}

.retrieval-candidate > header strong,
.retrieval-candidate > header span,
.retrieval-candidate > p {
  overflow-wrap: anywhere;
}

.retrieval-candidate > header > b {
  color: #1e675f;
  white-space: nowrap;
}

.retrieval-candidate > p {
  margin: 0;
}

.candidate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 14px;
}

.candidate-evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 280px));
  gap: 12px;
}

.candidate-evidence {
  display: grid;
  gap: 7px;
  margin: 0;
}

.candidate-evidence img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border: 1px solid #d9e2df;
  border-radius: 6px;
  background: #eef3f1;
}

.candidate-evidence figcaption {
  display: grid;
  gap: 3px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.diagnostic-paths {
  display: grid;
  margin: 0;
  border-top: 1px solid #d9e2df;
}

.diagnostic-paths > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid #d9e2df;
  padding: 10px 0;
}

.diagnostic-paths dt {
  color: #5b6b66;
  font-weight: 700;
}

.diagnostic-paths dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.artifact-head {
  margin-top: 24px;
}

.artifact-list {
  display: grid;
  border-top: 1px solid #d9e2df;
}

.artifact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid #d9e2df;
  padding: 11px 0;
}

.artifact-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.artifact-row > div span {
  color: #5b6b66;
  overflow-wrap: anywhere;
}

.artifact-row > span {
  color: #5b6b66;
  font-size: 13px;
  white-space: nowrap;
}

.diagnostic-overview span,
.issue-card span {
  color: #5b6b66;
}

.drawing-summary,
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.drawing-summary article,
.category-card {
  border: 1px solid #d9e2df;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.drawing-summary strong,
.category-card strong {
  display: block;
  margin-bottom: 6px;
}

.drawing-summary p,
.category-card p {
  margin: 0;
  color: #5b6b66;
  overflow-wrap: anywhere;
}

.category-card span {
  display: inline-block;
  margin-bottom: 6px;
  color: #1e675f;
  font-weight: 700;
}

.drawing-issue-layout {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.drawing-issue-section {
  display: grid;
  gap: 10px;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.drawing-issue-section h3 {
  margin: 0;
}

.section-head.compact {
  margin: 0;
}

.format-issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.format-issue-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fbfa;
}

.format-issue-card img,
.issue-image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #eef3f1;
}

.issue-image-placeholder {
  display: grid;
  place-items: center;
  color: #5b6b66;
  font-weight: 700;
}

.format-issue-body {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.format-issue-body span {
  color: #1e675f;
  font-weight: 700;
}

.format-issue-body p {
  margin: 0;
}

.format-issue-body small {
  color: #5b6b66;
  overflow-wrap: anywhere;
}

.report-snippet {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #24322f;
  font-family: inherit;
  line-height: 1.65;
}

.empty-state {
  margin: 0;
  color: #5b6b66;
}

.type-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-counts span {
  border: 1px solid #d9e2df;
  border-radius: 999px;
  background: #ffffff;
  color: #1e675f;
  font-weight: 700;
  padding: 4px 10px;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.evidence-card {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.evidence-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #eef3f1;
}

.evidence-card figcaption {
  color: #5b6b66;
  font-size: 14px;
  padding: 0 10px 10px;
}

.evidence-card.issue-evidence-panel {
  grid-column: 1 / -1;
  justify-self: stretch;
  width: 100%;
  max-width: none;
}

.issue-evidence-set {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  width: 100%;
}

.evidence-card.issue-evidence-panel img {
  display: block;
  justify-self: center;
  width: auto;
  max-width: min(100%, 960px);
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.evidence-card.issue-evidence-panel figcaption {
  text-align: center;
}

.issue-list {
  display: grid;
  gap: 10px;
}

.issue-card {
  display: grid;
  gap: 6px;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.issue-card.grouped {
  gap: 12px;
}

.issue-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e3ebe8;
  padding-bottom: 10px;
}

.issue-group-items {
  display: grid;
  gap: 12px;
}

.issue-group-items .issue-content + .issue-content {
  border-top: 1px solid #edf3f1;
  padding-top: 12px;
}

.issue-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.issue-content > * {
  grid-column: 1 / -1;
}

.issue-card strong,
.issue-card p {
  overflow-wrap: anywhere;
}

.issue-summary {
  color: #25343a;
  margin-bottom: 10px;
}

.issue-judgement {
  border-top: 1px solid #e3ebe8;
  padding-top: 10px;
}

.issue-judgement b {
  display: block;
  margin-bottom: 6px;
}

.issue-judgement p {
  margin: 0;
  line-height: 1.75;
}

.report-box {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  background: #fff;
  color: #172026;
  border: 1px solid #d9e2df;
  border-radius: 6px;
  padding: 12px;
  font-family: inherit;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .topbar,
  .top-actions,
  .stage-head,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .choice-grid.two,
  .choice-grid.three,
  .choice-grid.four,
  .choice-grid.mode-grid,
  .workspace,
  .intro-grid,
  .issue-content {
    grid-template-columns: 1fr;
  }

  .diagnostic-overview,
  .result-panel-head,
  .retrieval-candidate > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .diagnostic-result-stats {
    justify-content: flex-start;
  }

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

  .diagnostic-result-tabs button:nth-child(3) {
    border-left: 0;
  }

  .diagnostic-result-tabs button:nth-child(n + 3) {
    border-top: 1px solid #c7d8d3;
  }

  .candidate-evidence-grid,
  .artifact-row,
  .diagnostic-paths > div {
    grid-template-columns: 1fr;
  }

  .artifact-row > span {
    white-space: normal;
  }
}
