:root {
  --bg: #f6faf6;
  --panel: #ffffff;
  --text: #1e2a22;
  --muted: #6a786f;
  --line: #dbe8dd;
  --soft: #edf6ef;
  --accent: #6c8d71;
  --accent-strong: #4d6a53;
  --shadow: 0 16px 40px rgba(47, 73, 55, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, #f8fff8 0, #f6faf6 36%, #f2f7f3 100%);
  color: var(--text);
  min-height: 100vh;
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
  margin-top: 20px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(74, 111, 165, 0.15), rgba(74, 111, 165, 0.02));
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--accent-strong);
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 999px;
  padding: 8px 12px;
  margin-bottom: 16px;
}

h1, h2, h3, p { margin: 0; }
.hero h1 {
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 680px;
}
.hero .sub {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  max-width: 720px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 18px;
  align-items: stretch;
  margin-top: 24px;
}

.mini-panel {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfefb, #f3f8f4);
}

.mini-panel h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.mini-panel ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero-minimal {
  min-height: 48vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 42px 20px;
}
.hero-minimal::after { display: none; }
.hero-minimal h1 {
  max-width: none;
  margin: 0;
}
.hero-actions-single {
  justify-content: center;
  margin-top: 28px;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
  font: inherit;
}

button:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(45, 90, 135, 0.2);
  font-weight: 700;
}

.btn-secondary {
  background: #fff;
  color: var(--accent-strong);
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-weight: 700;
}

.screen { display: none; }
.screen.active { display: block; }

.test-wrap,
.result-wrap {
  margin-top: 22px;
  padding: 22px;
}

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

.progress {
  flex: 1;
  min-width: 240px;
  height: 10px;
  background: #edf3ee;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #97b59c, #5b7a62);
  border-radius: inherit;
  transition: width .22s ease;
}

.progress-text {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

/* Version Selection */
.version-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.version-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.version-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 90, 135, 0.12);
  border-color: var(--accent);
}

.version-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--accent-strong);
}

.version-card .meta {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.version-card .meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.version-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.version-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.badge-quick {
  background: #fef3c7;
  color: #92400e;
}

.badge-standard {
  background: #dbeafe;
  color: #1e40af;
}

.badge-full {
  background: #f3e8ff;
  color: #7c3aed;
}

.question-list {
  display: grid;
  gap: 16px;
}

.question {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #fafcfe);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.question-title {
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.option:hover {
  border-color: #bcd0c1;
  background: #f8fcf9;
}

.option.selected {
  border-color: var(--accent-strong);
  background: var(--soft);
}

.option input {
  margin-top: 3px;
  accent-color: var(--accent-strong);
  transform: scale(1.1);
  flex-shrink: 0;
}

.option-code {
  font-weight: 800;
  color: var(--accent-strong);
  min-width: 22px;
}

.actions-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 6px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* Result Page */
.result-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: stretch;
}

.type-box,
.score-box,
.dim-box,
.about-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #fafcfe);
}

.type-kicker {
  font-size: 12px;
  color: var(--accent-strong);
  margin-bottom: 8px;
  letter-spacing: .05em;
}

.type-name {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.type-subname {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.match {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 700;
}

.type-desc {
  margin-top: 18px;
  line-height: 1.85;
  font-size: 15px;
  color: #304034;
}

.score-box h3,
.dim-box h3,
.about-box h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

/* Dimension Bars */
.dim-bar-container {
  margin: 16px 0;
}

.dim-bar-item {
  margin-bottom: 16px;
}

.dim-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 14px;
}

.dim-bar-label .left {
  font-weight: 600;
  color: var(--text);
}

.dim-bar-label .right {
  color: var(--muted);
  font-size: 13px;
}

.dim-bar {
  height: 8px;
  background: #edf3ee;
  border-radius: 999px;
  overflow: hidden;
}

.dim-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #97b59c, #5b7a62);
  border-radius: 999px;
  transition: width .3s ease;
}

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

.score-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.score-item .k {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.score-item .v {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-strong);
}

.about-box p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

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

.result-layout {
  display: grid;
  gap: 18px;
}
.result-top {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
  align-items: stretch;
}

.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* Language switcher */
.lang-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
  box-shadow: 0 4px 12px rgba(45, 90, 135, 0.08);
}
.lang-switch:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(45, 90, 135, 0.12);
}

/* Wiki pages */
.wiki-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  align-items: start;
  margin-top: 24px;
}
.wiki-poster {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f5f8fc);
  position: sticky;
  top: 80px;
  padding: 20px;
  text-align: center;
}
.wiki-poster img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 16px;
}
.wiki-poster .type-icon {
  font-size: 80px;
  margin-bottom: 16px;
}
.wiki-poster .type-full-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-strong);
}
.wiki-poster .type-category {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.wiki-info h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.wiki-info .wiki-subtitle {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 24px;
}
.wiki-info .wiki-desc {
  line-height: 2;
  font-size: 16px;
  color: #304034;
}
.wiki-cta {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.wiki-breadcrumb {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}
.wiki-breadcrumb a {
  color: var(--accent-strong);
  text-decoration: none;
}

/* Type grid (wiki index) */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.type-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fafcfe);
  text-decoration: none;
  color: var(--text);
  transition: transform .16s ease, box-shadow .16s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.type-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}
  text-align: center;
  gap: 8px;
}
.type-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 90, 135, 0.1);
}
.type-card .card-code {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-strong);
}
.type-card .card-name {
  font-size: 13px;
  color: var(--muted);
}
.type-card .card-category {
  font-size: 11px;
  color: var(--muted);
  background: var(--soft);
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 4px;
}

/* Category section */
.category-section {
  margin-top: 32px;
}
.category-title {
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  color: var(--accent-strong);
}

/* Wiki info sections */
.wiki-section {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff, #fafcfe);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.wiki-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--accent-strong);
}
.wiki-section ul {
  margin: 0;
  padding-left: 20px;
  color: #304034;
  line-height: 1.9;
  font-size: 14px;
}
.wiki-section p {
  color: #304034;
  line-height: 1.9;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 860px) {
  .hero-grid,
  .result-hero,
  .result-top {
    grid-template-columns: 1fr;
  }
  .wiki-layout {
    grid-template-columns: 1fr;
  }
  .wiki-poster {
    position: static;
  }
}

@media (max-width: 600px) {
  .shell { padding: 14px 12px 42px; }
  .hero, .test-wrap, .result-wrap { padding: 16px; }
  .hero h1 { font-size: 32px; }
  .question-title { font-size: 15px; }
  .version-grid { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
