/* SBTI 测试页：浅薄荷底 + 白卡片 + 灰描边 + 墨绿主色 */
:root {
  --page-bg: #f4f9f4;
  --card-bg: #ffffff;
  --border: #e3e8e3;
  --border-strong: #d0d8d0;
  --green: #4a674f;
  --green-hover: #3d5642;
  --green-soft: #eef4ee;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-hint: #b0b8b0;
  --radius-shell: 28px;
  --radius-inner: 16px;
  --radius-btn: 14px;
  --radius-opt: 12px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.55;
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--green);
}

.shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.shell-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-shell);
  padding: 28px 22px 32px;
  box-shadow: none;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.is-active {
  display: block;
}

/* —— 首页 —— */
.hero-title {
  font-size: clamp(1.25rem, 4.2vw, 1.55rem);
  font-weight: 800;
  text-align: center;
  margin: 0 0 28px;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1.45;
}

.hero-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0 0 10px;
  line-height: 1.6;
}

.hero-note {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 22px;
  line-height: 1.65;
}

/* 给搜索引擎的简短说明，视觉上保持低调 */
.seo-lede {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-hint);
  margin: -12px 0 20px;
  line-height: 1.6;
  max-width: 26em;
  margin-left: auto;
  margin-right: auto;
}

.footer-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-hint);
  margin-top: 24px;
  line-height: 1.6;
}

.btn-primary {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 32px auto 0;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--green);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--green-hover);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 12px 20px;
  border-radius: var(--radius-btn);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green);
}

/* —— 答题页：顶栏进度 —— */
.progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.progress-bar-wrap {
  flex: 1;
  min-width: 0;
}

.progress-bar {
  height: 12px;
  background: #ecefec;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.progress-count {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 3.2em;
  text-align: right;
}

.quiz-tip {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 22px;
  padding: 12px 14px;
  background: var(--page-bg);
  border-radius: var(--radius-inner);
  border: 1px solid var(--border);
  line-height: 1.6;
}

/* —— 题目卡片 —— */
.question-block {
  margin-bottom: 22px;
  padding: 16px 14px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
}

.question-block-missing {
  border-color: #d9534f !important;
  box-shadow: 0 0 0 2px rgba(217, 83, 79, 0.12);
}

.q-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.q-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--green-soft);
  border: 1px solid var(--border);
}

.q-meta {
  font-size: 0.75rem;
  color: var(--text-hint);
  flex-shrink: 0;
}

.question-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px;
  line-height: 1.55;
  color: var(--text);
}

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

.option {
  display: block;
  cursor: pointer;
}

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

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-opt);
  border: 1px solid var(--border-strong);
  background: var(--card-bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.option:hover .option-card {
  border-color: #b8c4b8;
}

.option input:checked + .option-card {
  border-color: var(--green);
  background: var(--green-soft);
}

.opt-ui {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

.opt-dot {
  width: 18px;
  height: 18px;
  border: 2px solid #c5ccc5;
  border-radius: 50%;
  flex-shrink: 0;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.option input:checked + .option-card .opt-dot {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px #fff;
}

.opt-letter {
  font-size: 1rem;
  font-weight: 800;
  color: var(--green);
  min-width: 1.1em;
  line-height: 1.2;
}

.opt-label {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.5;
  padding-top: 1px;
}

.quiz-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 26px;
}

.quiz-actions .btn-primary {
  margin: 0;
  max-width: none;
}

/* —— 结果页 —— */
.result-card {
  text-align: center;
  padding: 10px 10px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fbfdfb;
}

.result-avatar {
  width: 100% !important;
  max-width: 420px;
  height: auto !important;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
}

.result-type-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.result-type-name {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--text);
}

.result-match {
  font-size: 1.0625rem;
  color: var(--green);
  font-weight: 700;
  margin: 0 0 14px;
  display: none;
}

.result-hit-module {
  margin: 6px auto 6px;
  text-align: left;
}

.result-hit-pill {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #edf4ef;
  color: #4d5f52;
  font-size: 0.97rem;
  font-weight: 700;
}

.result-hit-note {
  margin: 6px 0 0;
  color: #6f7c72;
  font-size: 0.84rem;
  line-height: 1.55;
}

.section-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 26px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.result-quick {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f7faf7;
  border: 1px solid var(--border);
  color: #5f6a62;
  font-size: 0.95rem;
  line-height: 1.6;
}

.result-more {
  margin-top: 4px;
}

.section-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.section-body .one-liner {
  color: var(--text);
  font-weight: 600;
  margin: 0 0 10px;
}

.dim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  overflow: hidden;
}

.dim-table th,
.dim-table td {
  padding: 10px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.dim-table tr:last-child td,
.dim-table tr:last-child th {
  border-bottom: none;
}

.dim-table th {
  color: var(--green);
  font-weight: 700;
  background: var(--green-soft);
  width: 30%;
}

.dim-table .dim-name {
  color: var(--text);
  font-weight: 600;
}

.dim-table .lvl {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 800;
  margin-right: 6px;
  border: 1px solid var(--border);
}

.dim-table .lvl-L {
  background: #e8eef8;
  color: #4a5a7a;
}

.dim-table .lvl-M {
  background: #f3f3f3;
  color: #555;
}

.dim-table .lvl-H {
  background: var(--green-soft);
  color: var(--green);
}

.disclaimer {
  margin-top: 24px;
  padding: 14px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--page-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  line-height: 1.65;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px auto 0;
  max-width: 420px;
}

.result-actions .btn-primary,
.result-actions .btn-ghost {
  width: 100%;
  min-height: 48px;
  margin: 0;
}

.load-error {
  color: #c0392b;
  text-align: center;
  padding: 20px 16px;
  font-size: 0.875rem;
  background: #fdecea;
  border-bottom: 1px solid #f5c6cb;
}

@media (min-width: 480px) {
  .quiz-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }

  .quiz-actions .btn-primary {
    flex: 1;
    min-width: 160px;
    max-width: 220px;
  }

  .quiz-actions .btn-ghost {
    order: -1;
  }
}

/* ── 导航栏 ── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-weight: 800;
  font-size: 0;
  color: transparent;
  text-decoration: none;
  margin-right: auto;
  letter-spacing: .02em;
  position: relative;
  min-width: 84px;
}

.nav-logo::after {
  content: "SBTI 人格测评";
  font-size: 1rem;
  color: var(--green);
}

.nav-link {
  font-size: .875rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}

.nav-link:hover {
  background: var(--green-soft);
  color: var(--green);
}

.nav-cta {
  background: var(--green);
  color: #fff !important;
  font-weight: 600;
}

.nav-cta:hover {
  background: var(--green-hover) !important;
  color: #fff !important;
}

.nav-lang {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  padding: 4px 10px !important;
  font-size: .82rem;
  color: var(--text-secondary) !important;
  text-decoration: none;
}

.nav-lang:hover {
  border-color: var(--green);
  color: var(--green) !important;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 28px 20px 40px;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.8;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer p {
  margin: 0;
}

/* ── SEO 内容区（首页底部） ── */
.seo-content-section {
  margin-top: 8px;
}

.seo-content-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 22px 22px 18px;
}

.seo-content-card h2 {
  font-size: .95rem;
  font-weight: 700;
  margin: 16px 0 6px;
  color: var(--text);
}

.seo-content-card h2:first-child {
  margin-top: 0;
}

.seo-content-card p {
  font-size: .875rem;
  color: var(--text-secondary);
  margin: 0 0 4px;
  line-height: 1.65;
}

.hero-links {
  margin-top: 10px !important;
  line-height: 1.7;
}

.result-domain {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px 14px;
  margin: 0 auto 12px;
  border: 1px dashed var(--green);
  border-radius: 12px;
  font-size: 0.86rem;
  color: #3f4f42;
  background: #f3fbf1;
}

.result-domain a {
  color: var(--green);
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
}

.mini-copy-btn {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.75rem;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
}

.mini-copy-btn:hover {
  color: var(--green);
  border-color: var(--green);
}

.result-link-btn {
  text-decoration: none;
}

@media (max-width: 768px) {
  .site-nav {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .nav-logo {
    min-width: 72px;
  }

  .nav-logo::after {
    font-size: 0.92rem;
  }

  .nav-link {
    font-size: 0.82rem;
    padding: 4px 8px;
  }

  .shell {
    padding: 12px 10px 24px;
  }

  .shell-card {
    padding: 20px 14px 22px;
    border-radius: 20px;
  }

  .hero-title {
    margin-bottom: 16px;
  }

  .question-block {
    padding: 12px 10px 14px;
    margin-bottom: 14px;
  }

  .option-card {
    padding: 10px 10px;
    gap: 8px;
  }

  .opt-label {
    font-size: 0.9rem;
  }

  .result-actions .btn-primary,
  .result-actions .btn-ghost,
  .result-actions .result-link-btn {
    width: 100%;
  }

  .result-domain {
    width: 100%;
    justify-content: space-between;
    font-size: 0.82rem;
  }

  .result-hit-pill {
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
  }

  .result-domain a {
    font-size: 0.9rem;
    max-width: 46%;
    overflow-wrap: anywhere;
  }

  .mini-copy-btn {
    font-size: 0.74rem;
    padding: 5px 8px;
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 1.12rem;
    line-height: 1.4;
  }

  .seo-lede {
    font-size: 0.78rem;
    margin-top: -6px;
  }

  .q-card-head {
    align-items: flex-start;
  }

  .q-meta {
    max-width: 45%;
    text-align: right;
    line-height: 1.35;
  }
}
