:root {
  --bg: #f4f2ef;
  --surface: #fff;
  --text: #1c1b19;
  --muted: #5c5854;
  --accent: #2d6a4f;
  --accent-hover: #1b4332;
  --border: #d8d4ce;
  --nav-active: #e8f0ec;
  --star-on: #c9a227;
  --star-off: #c5c0b8;
  --danger: #9b2226;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.site-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem;
}

.view[hidden] {
  display: none !important;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.intro-card h2 {
  margin-top: 0;
  font-size: 1.35rem;
}

.intro-text {
  white-space: pre-wrap;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.btn {
  font: inherit;
  cursor: pointer;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn:hover {
  background: #f0eeeb;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.test-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 768px) {
  .test-layout {
    grid-template-columns: 1fr;
  }
}

.question-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1rem 1.25rem;
  position: sticky;
  top: 0.75rem;
}

.nav-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.nav-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.question-list {
  margin: 0;
  padding: 0.2rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-height: 50vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.question-list button {
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.35rem;
  font-size: 0.875rem;
  line-height: 1;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  flex: 0 0 auto;
}

.question-list button:hover {
  background: #f0eeeb;
}

.question-list button.is-active {
  box-shadow: 0 0 0 2px var(--accent);
  background: var(--nav-active);
}

.question-list button.is-done {
  background: #dfece4;
  border-color: #a3c4b2;
}

.progress-wrap {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.question-card .question-meta {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.question-text {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
}

.star-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.star-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 3.5rem;
  padding: 0.5rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: var(--text);
}

.star-btn:hover {
  background: #faf9f7;
}

.star-btn.is-selected {
  border-color: var(--accent);
  background: var(--nav-active);
  box-shadow: 0 0 0 1px var(--accent);
}

.star-visual {
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: var(--star-off);
  line-height: 1;
}

.star-btn.is-selected .star-visual,
.star-btn:hover .star-visual {
  color: var(--star-on);
}

.star-num {
  font-size: 0.72rem;
  color: var(--muted);
}

.star-btn.is-selected .star-num {
  color: var(--text);
}

.star-legend {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.test-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.submit-wrap {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.report-card {
  padding-bottom: 2rem;
}

.report-main-title {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.report-section-title {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.35;
}

.report-section-title:first-of-type {
  margin-top: 0;
}

.report-restart-wrap {
  margin-top: 2.75rem;
  padding-top: 0.75rem;
}

.dimension-score-list {
  list-style: none;
  padding-left: 0;
}

.dimension-score-item {
  margin-bottom: 0.85rem;
}

.dimension-score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.dimension-score-label {
  flex: 1 1 12rem;
  min-width: 0;
}

.btn.linkish {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.btn.linkish:hover {
  background: var(--nav-active);
  color: var(--accent-hover);
}

.dimension-desc-block {
  margin: 0.45rem 0 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  color: var(--text);
  background: #f7f6f4;
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: pre-wrap;
}

.dimension-desc-block[hidden] {
  display: none !important;
}

.match-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.match-item {
  margin-bottom: 2rem;
}

.match-item:last-child {
  margin-bottom: 0.5rem;
}

.match-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.65rem;
}

.match-name {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  margin: 0;
}

.match-percent {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.match-picture-frame {
  width: 750px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  background: #ecebe8;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.match-picture-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f5f4f1;
}

.btn-show-type-desc {
  margin-bottom: 0.5rem;
}

.match-desc {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}

.match-desc[hidden] {
  display: none !important;
}

.error-card h2 {
  color: var(--danger);
  margin-top: 0;
}

.error-card code {
  font-size: 0.85em;
  background: #eee;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
