:root {
  --bg: #f6faf6;
  --bg-soft: #edf6ef;
  --text: #1e2a22;
  --muted: #6a786f;
  --line: rgba(77, 106, 83, 0.15);
  --accent: #6c8d71;
  --accent-strong: #4d6a53;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg);
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  line-height: 1.6;
}

.shell {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 16px 80px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Header & Lang Switcher */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 60px;
}

.site-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--accent-strong);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.2s ease;
}

.site-title:hover,
.site-title:focus-visible {
  opacity: 0.72;
  outline: none;
}

.language-switcher {
  position: relative;
}

.lang-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}



.lang-dropdown-btn img {
  width: 16px;
  height: 16px;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.language-switcher.is-open .lang-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}



.lang-dropdown-item.is-current {
  color: var(--accent-strong);
  font-weight: 700;
}

.lang-dropdown-item img {
  width: 16px;
  height: 16px;
  opacity: 0;
}

.lang-dropdown-item.is-current img {
  opacity: 1;
}

/* Intro Screen */
.screen {
  display: none;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 80px;
}

.slogan {
  font-size: clamp(48px, 8vw, 84px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 24px;
  color: var(--text);
}

.sub {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 360px;
  margin: 0 auto;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: all 0.2s ease;
}

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

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
  padding: 18px 24px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
}


.btn-secondary {
  background: transparent;
  color: var(--accent-strong);
  border: 1px solid var(--accent-strong);
  padding: 16px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
}


.buttons-row {
  display: flex;
  gap: 12px;
}

.buttons-row button {
  flex: 1;
}

.share-note,
.saved-result-note {
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}

/* Test Screen */
.test-wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  box-sizing: border-box;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--text);
}

.progress {
  flex: 1;
  height: 4px;
  background: rgba(0, 0, 0, 0.05);
  margin-right: 20px;
}

.progress>span {
  display: block;
  height: 100%;
  background: var(--text);
  transition: width 0.3s ease;
}

.progress-text {
  font-weight: 700;
  font-size: 14px;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.question {
  background: transparent;
  border: none;
  width: 100%;
  box-sizing: border-box;
}

.question-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.question-title {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 30px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}



.option input:checked+.option-code+div {
  font-weight: 700;
  color: var(--accent-strong);
}

.option input {
  position: absolute;
  opacity: 0;
}

.option-code {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  margin-right: 16px;
  transition: all 0.2s;
}

.option input:checked+.option-code {
  background: var(--accent-strong);
  color: #fff;
}

.actions-bottom {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.action-cluster {
  display: flex;
  gap: 12px;
  width: 100%;
}

.action-cluster button {
  flex: 1;
}

/* Result Screen */
.result-layout {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.result-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.result-side,
.type-box {
  min-width: 0;
}

@media(min-width: 768px) {
  .result-top {
    grid-template-columns: 320px 1fr;
  }
}

.poster-box {
  background: #fff;
  border: 1px solid rgba(219, 232, 221, 0.4);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  min-height: 220px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
}

.poster-qr-box {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.float-qr {
  width: 48px;
  height: 48px;
}

.poster-qr-box span {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
}

.type-kicker {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-strong);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.type-name {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.match {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  margin-bottom: 24px;
  max-width: 100%;
  white-space: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.type-subname {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 32px;
  overflow-wrap: anywhere;
}

.quote-box {
  border-left: 4px solid var(--accent-strong);
  padding-left: 20px;
}

.quote-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.quote-text {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  overflow-wrap: anywhere;
}

.analysis-box {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.analysis-box h3,
.radar-box h3,
.dim-box h3,
.note-box h3,
.share-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}

.analysis-box p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}

.insights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}

@media(min-width: 768px) {
  .insights-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.radar-box {
  background: #fff;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  align-self: start;
}

.radar-canvas-wrap {
  position: relative;
  width: 100%;
  width: min(100%, 460px);
  min-height: 220px;
  aspect-ratio: 1 / 1;
  max-height: 480px;
  max-width: 100%;
  margin: 0 auto;
}

.dim-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dim-item {
  background: transparent;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.dim-item-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dim-item-name {
  font-weight: 700;
  font-size: 15px;
}

.dim-item-score {
  font-weight: 800;
  color: var(--accent-strong);
}

.dim-item p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.share-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--text);
  color: #fff;
  padding: 40px 30px;
  border-radius: 20px;
  text-align: center;
  gap: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

@media(min-width: 600px) {
  .share-card {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
  }
}

.share-card h3 {
  margin: 0 0 12px;
  color: #fff;
}

.share-card p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
  font-size: 15px;
}

.share-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

@media(min-width: 600px) {
  .share-action-row {
    justify-content: flex-start;
  }
}

.share-url {
  display: inline-block;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 12px;
  font-family: monospace;
  text-decoration: none;
  font-weight: 700;
  transition: background 0.2s;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}



#inCardShareBtn {
  background: #fff;
  color: var(--text);
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.2s;
}

#inCardShareBtn:active {
  transform: scale(0.97);
}

.share-qr {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 40px;
}

@media(min-width: 601px) {
  .result-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
  }
}

@media(max-width: 600px) {
  .shell {
    padding: 12px 10px 40px;
  }

  .question {
    padding: 16px 12px;
    gap: 16px;
    margin-bottom: 20px;
  }

  .question-text {
    font-size: 17px;
    margin-bottom: 12px;
  }

  .options {
    gap: 10px;
  }

  .option {
    padding: 14px 12px;
  }

  .option-code {
    width: 24px;
    height: 24px;
    font-size: 11px;
    margin-right: 12px;
  }

  .type-name {
    font-size: 40px;
  }

  .share-action-row,
  .action-cluster,
  .buttons-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
  }

  .share-url,
  #inCardShareBtn {
    width: 100%;
    text-align: center;
  }

  .poster-box {
    min-height: 200px;
    aspect-ratio: 1 / 1.1;
  }

  .radar-box {
    padding: 18px 14px;
  }

  .radar-canvas-wrap {
    width: 100%;
    min-height: min(72vw, 280px);
    aspect-ratio: 1 / 1;
  }
}

.btn-primary,
.btn-secondary {
  width: 100%;
  display: block;
  text-align: center;
  box-sizing: border-box;
}

@media(min-width: 601px) {

  .btn-primary,
  .btn-secondary {
    width: auto;
    display: inline-block;
  }
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.all-types-section {
  margin-top: 100px;
  padding-top: 60px;
  border-top: 1px solid var(--line);
}

.all-types-section h2 {
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.all-types-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 40px;
}

.all-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
}

.type-card-mini {
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px 16px;
  border-radius: 16px;
  text-align: center;
  transition: transform 0.2s;
}



.type-img-mini {
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin-bottom: 16px;
  border-radius: 8px;
}

.tc-code-mini {
  font-weight: 900;
  font-size: 18px;
  margin-bottom: 4px;
}

.tc-cn-mini {
  font-size: 13px;
  color: var(--muted);
}

.tc-tag-mini {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-soft);
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  margin-top: 8px;
}

[hidden] {
  display: none !important;
}

@media(max-width: 480px) {
  .radar-box {
    padding: 14px 12px;
    border-radius: 12px;
  }

  .radar-canvas-wrap {
    min-height: min(78vw, 250px);
  }
}