/* ============================
   CSTI 校园型人格测试 - 样式表
   主题：清新绿白 + 自然系配色
   ============================ */

/* NOTE: 使用SBTI同风格的清新绿白主题，更大众化审美 */
:root {
  --bg: #f4f9f4;
  --panel: #ffffff;
  --text: #1e2a22;
  --muted: #6a786f;
  --line: #dbe8dd;
  --soft: #edf6ef;
  --accent: #6c8d71;
  --accent-strong: #4d6a53;
  --accent-light: #a8c5ad;
  --shadow: 0 16px 40px rgba(47, 73, 55, 0.08);
  --shadow-sm: 0 4px 12px rgba(47, 73, 55, 0.06);
  --radius: 22px;
  --radius-sm: 14px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

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%, var(--bg) 36%, #f0f5f1 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ============ 容器 ============ */
.shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

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

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

/* ============ 通用卡片 ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ============ 首页 Hero ============ */
.hero {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 48px 28px;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
}

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

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

.hero h1 {
  font-size: clamp(36px, 7vw, 60px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 18px;
}

.hero .subtitle {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 32px;
}

.hero-footer {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

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

/* ============ 按钮 ============ */
button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

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

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 12px 30px rgba(77, 106, 83, 0.18);
}

.btn-primary:hover {
  box-shadow: 0 14px 36px rgba(77, 106, 83, 0.28);
}

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

.btn-secondary:hover {
  background: var(--soft);
}

/* ============ 测试页面 ============ */
.test-wrap {
  padding: 24px;
  margin-top: 16px;
}

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

.progress {
  flex: 1;
  min-width: 200px;
  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.25s ease;
}

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

/* ============ 题目列表 ============ */
.question-list {
  display: grid;
  gap: 18px;
}

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

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
}

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

.question-title {
  font-size: 16px;
  line-height: 1.8;
  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 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: all 0.16s ease;
}

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

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

.option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent-strong);
  transform: scale(1.1);
  flex-shrink: 0;
  cursor: pointer;
}

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

.option-text {
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

/* ============ 底部操作 ============ */
.actions-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 6px;
}

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

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

/* ============ 结果页 ============ */
.result-wrap {
  padding: 24px;
  margin-top: 16px;
}

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

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

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

/* 图片展示框 */
.poster-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(127, 165, 134, 0.12), rgba(127, 165, 134, 0) 50%),
    linear-gradient(180deg, #ffffff, #f7fbf8);
}

.poster-image {
  width: 100%;
  min-height: 200px;
  max-height: 420px;
  object-fit: contain;
  border-radius: 16px;
}

.poster-box.no-image .poster-image { display: none; }

.poster-caption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.8;
}

/* 类型信息 */
.type-kicker {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.type-name {
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.type-subname {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

/* 搭子 & 克星 */
.relation-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.relation-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.7;
}

.relation-icon {
  display: inline-block;
  width: 20px;
  flex-shrink: 0;
  text-align: center;
}

.relation-label {
  white-space: nowrap;
  flex-shrink: 0;
}

.partner-label { color: var(--accent-strong); }
.nemesis-label { color: #c44d3f; }

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

/* 描述段落 */
.analysis-box h3,
.dim-box h3,
.note-box h3 {
  font-size: 16px;
  margin-bottom: 14px;
  color: var(--text);
}

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

/* ============ 维度评分列表 ============ */
.dim-list {
  display: grid;
  gap: 12px;
}

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

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

.dim-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

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

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

/* 维度进度条 */
.dim-bar {
  height: 5px;
  background: #edf3ee;
  border-radius: 999px;
  margin: 8px 0 8px;
  overflow: hidden;
}

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

/* ============ 提示框 ============ */
.note-box {
  background: linear-gradient(180deg, #fbfefb, #f3f8f4);
}

.note-box p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

/* ============ 作者折叠框 ============ */
.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 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  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: 600;
  color: var(--accent-strong);
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 6px 12px;
  border-radius: 999px;
}

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

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

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

/* ============ 结果底部操作 ============ */
.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* ============ 响应式 ============ */
@media (max-width: 860px) {
  .result-top { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .shell { padding: 14px 12px 48px; }
  .hero { padding: 32px 18px; min-height: 68vh; }
  .hero h1 { font-size: 32px; }
  .test-wrap, .result-wrap { padding: 16px; }
  .question { padding: 16px; }
  .question-title { font-size: 15px; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions button { width: 100%; }
  .btn-group { flex-direction: column; width: 100%; }
  .btn-group button { width: 100%; }
  .actions-bottom { flex-direction: column; align-items: stretch; }
}
