:root {
  --bg: #f6faf6;
  --panel: #ffffff;
  --text: #1f2a22;
  --muted: #69776f;
  --line: #dbe7dd;
  --soft: #edf5ee;
  --accent: #6f8f75;
  --accent-strong: #4d6a53;
  --accent-bright: #42a447;
  --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, #fbfffb 0, #f7fbf7 32%, #f0f6f1 100%);
  color: var(--text);
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

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

.screen {
  display: none;
}

.screen.active {
  display: block;
}

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

.hero,
.test-wrap,
.result-wrap {
  margin-top: 20px;
  padding: 24px;
}

.hero {
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  right: -72px;
  bottom: -72px;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(127, 165, 134, 0.18), rgba(127, 165, 134, 0.02));
  pointer-events: none;
}

.hero-minimal {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 44px 24px;
}

.hero-logo {
  width: min(118px, 26vw);
  height: auto;
  display: block;
  margin: 0 auto 14px;
  opacity: 0.96;
  filter: drop-shadow(0 6px 12px rgba(37, 44, 39, 0.08));
}

.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(30px, 5vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  max-width: 720px;
}

.sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.hero-sub {
  max-width: 480px;
  margin-top: 14px;
}

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

.hero-actions-single {
  justify-content: center;
}

.hero-meta {
  padding-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.btn-primary,
.btn-secondary {
  padding: 14px 20px;
  border-radius: 14px;
  font-weight: 700;
}

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 12px 30px rgba(77, 106, 83, 0.18);
}

.btn-secondary {
  background: #fff;
  color: var(--accent-strong);
  border: 1px solid var(--line);
}

.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;
}

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

.progress-text,
.hint {
  color: var(--muted);
  font-size: 13px;
}

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

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

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  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.8;
}

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

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

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

.option.is-selected {
  border-color: #96b59b;
  background: #f4faf5;
}

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

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

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

.action-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.result-layout {
  display: grid;
  gap: 18px;
}

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

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

.poster-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at top right, rgba(127, 165, 134, 0.16), rgba(127, 165, 134, 0) 42%), linear-gradient(180deg, #ffffff, #f7fbf8);
}

.poster-image {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 16px;
}

.poster-brand {
  width: 100%;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.poster-brand-logo {
  height: 34px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.poster-brand-name {
  color: #000000;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.type-kicker {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.2;
}

.type-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.type-name {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.type-name.is-long {
  font-size: clamp(26px, 3.6vw, 40px);
}

.type-content {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 110px;
  flex: 0 0 auto;
}

.type-primary {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 110px;
  text-align: center;
}

.type-side {
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 110px;
}

.code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--accent-bright);
  font-size: clamp(18px, 3.2vw, 26px);
  font-weight: 800;
  letter-spacing: 0.03em;
}

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

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-list-compact {
  gap: 8px;
  margin-top: 0;
  align-content: center;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

.tag-list-compact .tag-pill {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
}

.tag-pill.is-empty {
  color: var(--muted);
  font-weight: 600;
}

.analysis-box p,
.note-box p {
  color: #304034;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.note-box p {
  color: var(--muted);
  font-size: 14px;
}

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

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

.dim-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.dim-item-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.dim-item-score {
  color: var(--accent-bright);
  font-weight: 800;
  white-space: nowrap;
}

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

.dim-result {
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.author-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fbfdfb);
  overflow: hidden;
}

.author-box summary {
  list-style: none;
  cursor: pointer;
  padding: 18px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.author-box summary::-webkit-details-marker {
  display: none;
}

.author-box summary::after {
  content: "展开";
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 6px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.author-box[open] summary::after {
  content: "收起";
}

.author-content {
  border-top: 1px solid var(--line);
  padding: 0 18px 18px;
}

.author-content p {
  margin-top: 14px;
  color: #304034;
  font-size: 14px;
  line-height: 1.9;
}

.loading-card {
  margin-top: 20px;
  padding: 24px;
  text-align: center;
}

@media (max-width: 860px) {
  .result-top {
    grid-template-columns: 1fr;
  }

  .type-content {
    grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
    gap: 14px;
    min-height: 96px;
  }

  .poster-image {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 14px 12px 42px;
  }

  .hero,
  .test-wrap,
  .result-wrap {
    padding: 16px;
  }

  .hero-minimal {
    min-height: 48vh;
    padding: 36px 18px;
  }

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

  .hero-logo {
    width: min(96px, 28vw);
    margin-bottom: 12px;
  }

  .poster-box {
    padding: 14px clamp(14px, 4vw, 20px) 16px;
  }

  .poster-image {
    max-width: min(100%, 286px);
  }

  .poster-brand {
    gap: 10px;
  }

  .poster-brand-logo {
    height: 28px;
  }

  .poster-brand-name {
    font-size: 16px;
  }

  .question-title {
    font-size: 15px;
  }

  .dim-list {
    grid-template-columns: 1fr;
  }

  .type-subname,
  .type-summary,
  .analysis-box p {
    font-size: 14px;
  }

  .type-content {
    grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
    gap: 12px;
    min-height: 88px;
  }

  .type-name {
    font-size: clamp(28px, 8vw, 38px);
  }

  .type-name.is-long {
    font-size: clamp(22px, 6.4vw, 30px);
  }

  .tag-list-compact .tag-pill {
    padding: 5px 9px;
    font-size: 11px;
  }
}
