:root {
  --bg: #f4f8f5;
  --panel: #ffffff;
  --panel-alt: #f9fcfa;
  --text: #1a2e1f;
  --text-dim: #6b8571;
  --line: #d8e8db;
  --soft: #eaf4ec;
  --accent: #3d8b4f;
  --accent-dim: #5ba96a;
  --accent-light: #e2f5e6;
  --accent-glow: rgba(61, 139, 79, 0.12);
  --shadow: 0 4px 24px rgba(30, 60, 40, 0.06);
  --shadow-lg: 0 16px 48px rgba(30, 60, 40, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(61,139,79,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(61,139,79,0.04) 0%, transparent 50%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

/* ===== SCREENS ===== */
.screen { display: none; animation: fadeUp 0.35s ease; }
.screen.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== HERO ===== */
.hero-minimal {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  position: relative;
  overflow: hidden;
}
.hero-minimal::before {
  content: "";
  position: absolute;
  top: -120px; right: -120px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,139,79,0.08), transparent 70%);
  pointer-events: none;
}
.hero-minimal::after {
  content: "";
  position: absolute;
  bottom: -80px; left: -80px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61,139,79,0.05), transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--line);
  background: var(--accent-light);
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}
h1 {
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--text);
}
.hero-sub {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 15px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
  justify-content: center;
}
.hero-credits {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ===== BUTTONS ===== */
button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: all 0.2s ease;
}
button:hover { transform: translateY(-2px); }
button:active { transform: translateY(0); }
button:disabled { cursor: not-allowed; opacity: 0.4; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #3d8b4f, #2d7040);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(61,139,79,0.2);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(61,139,79,0.3); }

.btn-glow {
  animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(61,139,79,0.2); }
  50% { box-shadow: 0 8px 32px rgba(61,139,79,0.35); }
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 15px;
}
.btn-secondary:hover { border-color: var(--accent-dim); background: var(--soft); }
.btn-sm { padding: 10px 18px; font-size: 13px; }
.btn-icon { margin-right: 4px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== TEST ===== */
.test-wrap, .result-wrap, .gallery-wrap, .detail-wrap {
  padding: 24px;
  margin-top: 20px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.progress {
  flex: 1;
  min-width: 200px;
  height: 8px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #5ba96a, #3d8b4f);
  border-radius: inherit;
  transition: width 0.3s ease;
}
.progress-text { color: var(--text-dim); font-size: 13px; white-space: nowrap; }

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

.question {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff, #fbfdfb);
  transition: border-color 0.2s;
}
.question.answered { border-color: var(--accent-dim); }

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--accent-light);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 600;
}
.question-title {
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  color: var(--text);
}

.options { display: grid; gap: 10px; margin-top: 14px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
}
.option:hover {
  border-color: #bcd5c2;
  background: #f6fbf7;
}
.option.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}
.option input {
  margin-top: 3px;
  accent-color: var(--accent);
  transform: scale(1.15);
  flex-shrink: 0;
}
.option-code {
  font-weight: 800;
  color: var(--accent);
  min-width: 20px;
}

.actions-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 8px;
}
.hint { color: var(--text-dim); font-size: 13px; line-height: 1.7; }

/* ===== RESULT ===== */
.result-layout { display: grid; gap: 20px; }
.result-top {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 20px;
  align-items: stretch;
}

.poster-box, .type-box, .analysis-box, .deep-analysis-box,
.radar-box, .dim-box, .top3-box, .note-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff, #fafdf9);
}
.poster-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at top right, rgba(61,139,79,0.06), transparent 50%),
    linear-gradient(180deg, #ffffff, #f7fbf8);
}
.poster-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 16px;
}
.poster-box.no-image .poster-image { display: none; }
.poster-caption {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
}

.type-kicker {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.type-name {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: var(--text);
}
.type-subname, .type-intro {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.8;
}
.match {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--accent-light);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

.analysis-box h3, .deep-analysis-box h3, .radar-box h3,
.dim-box h3, .top3-box h3, .note-box h3 {
  font-size: 16px;
  margin-bottom: 14px;
  color: var(--text);
}
.analysis-box p, .note-box p {
  color: #3a5040;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
}

/* Deep analysis */
.deep-section { margin-bottom: 18px; }
.deep-section h4 {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.deep-section p, .deep-section li {
  color: #4a6450;
  font-size: 13px;
  line-height: 1.85;
}
.deep-section ul { padding-left: 18px; }
.deep-section li { margin-bottom: 4px; }

/* Radar / Model cards */
.radar-chart-wrap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.model-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #fff;
  text-align: center;
}
.model-card .model-name {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.model-card .model-score {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}
.model-card .model-bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 2px;
  background: var(--soft);
  overflow: hidden;
}
.model-card .model-bar span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #5ba96a, #3d8b4f);
  transition: width 0.5s ease;
}

/* Dims */
.dim-list { display: grid; gap: 12px; }
.dim-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #fff;
  transition: border-color 0.2s;
}
.dim-item:hover { border-color: #b8d4be; }
.dim-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.dim-item-name { font-size: 13px; font-weight: 700; color: var(--text); }
.dim-item-score {
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}
.dim-item-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--soft);
  margin-bottom: 8px;
  overflow: hidden;
}
.dim-item-bar span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #5ba96a, #3d8b4f);
}
.dim-item p { color: var(--text-dim); font-size: 12px; line-height: 1.7; margin: 0; }

/* Top3 */
.top3-list { display: grid; gap: 10px; }
.top3-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.top3-item:hover { border-color: #b8d4be; transform: translateX(4px); box-shadow: var(--shadow); }
.top3-item strong { display: block; margin-bottom: 2px; font-size: 14px; }
.top3-item span { color: var(--text-dim); font-size: 12px; }
.top3-score { color: var(--accent); font-weight: 800; font-size: 15px; white-space: nowrap; }

/* Author */
.author-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fafdf9);
  overflow: hidden;
}
.author-box summary {
  list-style: none;
  cursor: pointer;
  padding: 18px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.author-box summary::-webkit-details-marker { display: none; }
.author-box summary::after {
  content: '展开';
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--line);
  background: var(--accent-light);
  padding: 6px 12px;
  border-radius: 999px;
}
.author-box[open] summary::after { content: '收起'; }
.author-content {
  border-top: 1px solid var(--line);
  padding: 0 18px 18px;
}
.author-content p {
  margin: 12px 0 0;
  color: #4a6450;
  font-size: 13px;
  line-height: 1.8;
}

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

/* ===== GALLERY ===== */
.gallery-header {
  text-align: center;
  margin-bottom: 28px;
}
.gallery-header h2 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.gallery-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin: 8px 0 16px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.gallery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}
.gallery-card:hover {
  border-color: #b8d4be;
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(30,60,40,0.1);
}
.gallery-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--soft);
}
.gallery-card-body { padding: 12px; }
.gallery-card-code {
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}
.gallery-card-cn {
  font-size: 12px;
  color: var(--text-dim);
}
.gallery-card-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  color: var(--accent);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line);
}

/* Detail */
.detail-wrap { position: relative; }
.detail-layout { display: grid; gap: 20px; margin-top: 18px; }
.detail-top {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 20px;
  align-items: start;
}
.detail-poster {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--soft);
}
.detail-info {
  padding: 8px 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .result-top, .detail-top { grid-template-columns: 1fr; }
  .radar-chart-wrap { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .shell { padding: 12px 10px 48px; }
  .test-wrap, .result-wrap, .gallery-wrap, .detail-wrap { padding: 16px; }
  h1 { font-size: 28px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .radar-chart-wrap { grid-template-columns: repeat(2, 1fr); }
  .hero-actions { flex-direction: column; align-items: stretch; }
}
