/* ==========================================
   WYBI · 文艺 b 指数 样式表
   设计风格：简洁素雅 · 鼠尾草绿 · 极简衬线
   ========================================== */

:root {
  --bg:             #f6faf6;
  --bg-alt:         #eef3ef;
  --surface:        #ffffff;
  --border:         #d4e2d8;
  --border-light:   #e8f0ea;
  --primary:        #4d6a53;
  --primary-dark:   #3d5543;
  --primary-light:  #8ba894;
  --primary-lighter:#e8f0ea;
  --text:           #2c3a30;
  --text-light:     #5e6e62;
  --text-muted:     #8a9a8e;
  --accent:         #c9a76c;   /* 可选的暖色点缀 */
  --radius:         22px;
  --radius-sm:      14px;
  --shadow:         0 2px 24px rgba(77, 106, 83, 0.06);
  --shadow-hover:   0 6px 32px rgba(77, 106, 83, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 50px 20px 40px;
  min-height: calc(100vh - 80px);
}

/* ==========================================
   屏幕切换
   ========================================== */
.screen {
  display: none;
  animation: fadeIn 0.5s ease;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ==========================================
   Screen 1: Intro
   ========================================== */
.intro-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 56px 56px 56px;
  box-shadow: var(--shadow);
  text-align: center;
}

.intro-illustration {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
  color: var(--primary);
  animation: floatIn 0.9s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.intro-illustration svg {
  width: 150px;
  height: auto;
  max-width: 100%;
  filter: drop-shadow(0 4px 12px rgba(77, 106, 83, 0.10));
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.intro-tag {
  display: inline-block;
  padding: 7px 18px;
  background: var(--primary-lighter);
  color: var(--primary);
  border-radius: 30px;
  font-size: 12px;
  letter-spacing: 2.5px;
  margin-bottom: 28px;
  font-weight: 500;
}

.intro-title {
  font-size: 58px;
  line-height: 1.12;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 24px;
  letter-spacing: 3px;
}

.intro-sub {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 48px;
  font-style: italic;
  letter-spacing: 0.5px;
}

.intro-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 36px;
  margin-bottom: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.meta-num {
  font-size: 34px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.meta-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
}
.meta-sep {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.intro-desc {
  text-align: left;
  color: var(--text-light);
  font-size: 14.5px;
  line-height: 1.85;
  margin-bottom: 48px;
  padding: 0 10px;
}
.intro-desc p { margin-bottom: 14px; }
.intro-desc p:last-child { margin-bottom: 0; }
.intro-desc strong {
  color: var(--primary);
  font-weight: 500;
}
.intro-desc .hint {
  color: var(--text-muted);
  font-size: 13px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  margin-top: 22px;
  line-height: 1.8;
}

/* ==========================================
   Button
   ========================================== */
.btn-primary {
  display: inline-block;
  padding: 17px 54px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 4px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(77, 106, 83, 0.28);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-block;
  padding: 14px 38px;
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 50px;
  font-size: 14px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
}
.btn-secondary:hover {
  background: var(--primary-lighter);
}

/* ==========================================
   Screen 2: Test
   ========================================== */
.test-header {
  margin-bottom: 28px;
}
.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(to right, var(--primary-light), var(--primary));
  width: 5%;
  border-radius: 10px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-text {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  letter-spacing: 1.5px;
}

.question-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 48px 44px 40px;
  box-shadow: var(--shadow);
  animation: slideUp 0.35s ease;
}

.question-number {
  font-size: 12px;
  color: var(--primary);
  letter-spacing: 3px;
  margin-bottom: 18px;
  font-weight: 500;
}

.question-text {
  font-size: 21px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 34px;
  font-weight: 500;
}

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

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding: 20px 22px;
  background: #fafcfb;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
}
.option-btn:hover {
  border-color: var(--primary-light);
  background: var(--primary-lighter);
  transform: translateX(4px);
}
.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-lighter);
  transform: translateX(4px);
}
.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-lighter);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.2s;
}
.option-btn:hover .option-letter,
.option-btn.selected .option-letter {
  background: var(--primary);
  color: white;
}
.option-text { flex: 1; }

/* ==========================================
   Screen 3: Result
   ========================================== */
#result-container > * {
  margin-bottom: 22px;
  animation: slideUp 0.5s ease backwards;
}
#result-container > *:nth-child(1) { animation-delay: 0.05s; }
#result-container > *:nth-child(2) { animation-delay: 0.15s; }
#result-container > *:nth-child(3) { animation-delay: 0.25s; }
#result-container > *:nth-child(4) { animation-delay: 0.35s; }
#result-container > *:nth-child(5) { animation-delay: 0.45s; }

.result-tier,
.result-main,
.result-components,
.result-radar,
.result-special,
.result-actions {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 42px 40px;
  box-shadow: var(--shadow);
}

/* --- 段位卡片 --- */
.result-tier {
  text-align: center;
  padding: 56px 40px 48px;
}
.tier-emoji {
  font-size: 68px;
  margin-bottom: 16px;
  line-height: 1;
}
.tier-name {
  font-size: 38px;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: 3px;
  font-weight: 700;
}
.tier-sub {
  font-size: 15px;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 28px;
}
.tier-score {
  display: inline-block;
  padding: 11px 26px;
  background: var(--primary-lighter);
  color: var(--primary);
  border-radius: 30px;
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: 500;
}

.section-label {
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 3.5px;
  font-weight: 600;
  margin-bottom: 18px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- 主人格 --- */
.type-code {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.type-category {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-alt);
  color: var(--text-muted);
  border-radius: 20px;
  font-size: 11px;
  letter-spacing: 1px;
  margin-bottom: 22px;
}
.type-description {
  color: var(--text-light);
  font-size: 15px;
  line-height: 1.95;
  text-align: justify;
}
.type-description strong {
  color: var(--primary);
  font-weight: 500;
  /* 末句金句的特殊视觉 */
}
.type-description .highlight-line {
  display: block;
  margin-top: 16px;
  padding: 18px 22px;
  background: var(--primary-lighter);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--primary);
  font-weight: 500;
  font-style: italic;
  line-height: 1.8;
}

/* --- 成分构成 --- */
.components {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.component-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.component-rank {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-lighter);
  color: var(--primary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.component-row.other .component-rank {
  background: #f0f0f0;
  color: #999;
}
.component-info { flex: 1; min-width: 0; }
.component-name {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 7px;
  font-weight: 500;
}
.component-name .component-code {
  color: var(--primary);
  font-weight: 700;
  margin-right: 6px;
}
.component-bar {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 10px;
  overflow: hidden;
}
.component-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--primary-light), var(--primary));
  border-radius: 10px;
  transition: width 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.component-row.other .component-bar-fill {
  background: #c8c8c8;
}
.component-percent {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  min-width: 46px;
  text-align: right;
  letter-spacing: 0.5px;
}
.component-row.other .component-percent { color: #999; }

/* --- 雷达图 --- */
.result-radar { text-align: center; }
.radar-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}
#radar-canvas {
  max-width: 100%;
  height: auto;
}
.attribute-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding-top: 28px;
  border-top: 1px dashed var(--border);
}
.attribute-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
}
.attribute-emoji {
  font-size: 16px;
  margin-bottom: 2px;
}
.attribute-name {
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.5px;
}
.attribute-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2px;
}

/* --- 特殊结果 --- */
.result-special {
  text-align: center;
  padding: 64px 44px 52px;
}
.special-badge {
  display: inline-block;
  padding: 9px 22px;
  background: var(--primary);
  color: white;
  border-radius: 30px;
  font-size: 12px;
  letter-spacing: 3px;
  margin-bottom: 28px;
  font-weight: 500;
}
.result-special .type-code { font-size: 36px; }
.result-special .type-description { text-align: justify; margin-top: 24px; }

/* --- 底部按钮区 --- */
.result-actions {
  text-align: center;
  padding: 32px 40px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
  text-align: center;
  padding: 32px 20px 24px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 1.5px;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 640px) {
  .container { padding: 28px 14px 30px; }

  .intro-card { padding: 42px 26px 40px; }
  .intro-illustration { margin-bottom: 22px; }
  .intro-illustration svg { width: 120px; }
  .intro-title { font-size: 44px; letter-spacing: 2px; }
  .intro-sub { font-size: 14.5px; margin-bottom: 36px; }
  .intro-meta { gap: 20px; padding: 22px 0; margin-bottom: 36px; }
  .meta-num { font-size: 28px; }
  .intro-desc { padding: 0; font-size: 14px; margin-bottom: 36px; }
  .btn-primary { padding: 16px 44px; font-size: 14px; letter-spacing: 3px; }

  .question-card { padding: 34px 24px 30px; }
  .question-text { font-size: 18.5px; margin-bottom: 28px; }
  .option-btn { padding: 17px 18px; font-size: 14px; }

  .result-tier,
  .result-main,
  .result-components,
  .result-radar,
  .result-special,
  .result-actions {
    padding: 34px 24px;
  }
  .tier-name { font-size: 30px; }
  .tier-emoji { font-size: 56px; }
  .type-code { font-size: 26px; }
  .result-special .type-code { font-size: 28px; }
  .type-description { font-size: 14.5px; }
  .attribute-list { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .attribute-value { font-size: 19px; }
  .component-percent { font-size: 14px; min-width: 40px; }
  .footer { padding: 24px 14px 18px; }
}

@media (max-width: 380px) {
  .intro-title { font-size: 38px; }
  .intro-meta { gap: 14px; }
  .meta-num { font-size: 24px; }
  .tier-name { font-size: 26px; }
}
