/* ============================================================
   暗渊圣典 · Abyss Codex
   暗黑神秘学典籍 · 猩红 × 鎏金 × 骨白
   ============================================================ */

:root {
  --ink: #0b090f;
  --ink-2: #14101c;
  --ink-3: #1d1729;
  --bone: #e9e1d2;
  --bone-dim: #a89f8f;
  --bone-faint: #6f6759;
  --crimson: #c1121f;
  --crimson-glow: #ff2e3e;
  --gold: #c9a86a;
  --gold-bright: #ecd9a8;
  --virtue: #d4af37;
  --sin: #b3233a;
  --serif: "Noto Serif SC", serif;
  --roman: "Cinzel", serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--serif);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--crimson);
  color: var(--bone);
}

/* ---------- 氛围层 ---------- */
.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 55% at 50% -10%,
      rgba(193, 18, 31, 0.14),
      transparent 60%
    ),
    radial-gradient(
      ellipse 60% 45% at 85% 110%,
      rgba(201, 168, 106, 0.07),
      transparent 60%
    ),
    radial-gradient(
      ellipse 50% 40% at 8% 100%,
      rgba(90, 30, 60, 0.1),
      transparent 60%
    );
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 120% 100% at 50% 50%,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

.grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grainShift 1.2s steps(4) infinite;
}
@keyframes grainShift {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2%, 3%);
  }
  50% {
    transform: translate(3%, -2%);
  }
  75% {
    transform: translate(-3%, -3%);
  }
  100% {
    transform: translate(0, 0);
  }
}

.ember-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.ember {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--crimson-glow);
  box-shadow: 0 0 8px 2px rgba(255, 46, 62, 0.5);
  opacity: 0;
  animation: emberRise linear infinite;
}
.ember.gold {
  background: var(--gold-bright);
  box-shadow: 0 0 8px 2px rgba(236, 217, 168, 0.4);
}
@keyframes emberRise {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0;
  }
  8% {
    opacity: 0.9;
  }
  60% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-105vh) translateX(6vw) scale(0.3);
    opacity: 0;
  }
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid rgba(201, 168, 106, 0.14);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--bone);
}
.brand-sigil {
  font-size: 26px;
  color: var(--crimson);
  text-shadow: 0 0 18px rgba(193, 18, 31, 0.7);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.brand:hover .brand-sigil {
  transform: rotate(180deg);
}
.brand-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.14em;
}
.brand-text em {
  display: block;
  font-style: normal;
  font-family: var(--roman);
  font-size: 9px;
  letter-spacing: 0.42em;
  color: var(--gold);
  font-weight: 600;
}
.cookie-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--gold);
  border: 1px solid rgba(201, 168, 106, 0.3);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(20, 16, 28, 0.6);
  backdrop-filter: blur(6px);
  cursor: help;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
.cookie-badge:hover {
  border-color: rgba(201, 168, 106, 0.7);
  box-shadow: 0 0 20px rgba(201, 168, 106, 0.12);
}
.cookie-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ---------- 视图切换 ---------- */
main {
  position: relative;
  z-index: 1;
}
.view {
  display: none;
  animation: viewIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.view.is-active {
  display: block;
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 首页 ---------- */
.view-home {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 90px) clamp(20px, 5vw, 64px) 60px;
}

.hero {
  text-align: center;
  margin-bottom: clamp(48px, 7vw, 84px);
}
.hero-eyebrow {
  font-family: var(--roman);
  font-size: 11px;
  letter-spacing: 0.5em;
  color: var(--crimson-glow);
  margin-bottom: 22px;
  animation: viewIn 0.8s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero-title {
  font-size: clamp(44px, 9vw, 96px);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: 0.06em;
}
.hero-line {
  display: block;
  animation: viewIn 0.9s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero-line-accent {
  animation-delay: 0.32s;
  background: linear-gradient(
    115deg,
    var(--gold-bright) 10%,
    var(--gold) 40%,
    var(--crimson-glow) 90%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 26px rgba(193, 18, 31, 0.28));
}
.hero-sub {
  margin-top: 26px;
  color: var(--bone-dim);
  font-size: clamp(14px, 1.8vw, 16.5px);
  line-height: 2;
  letter-spacing: 0.1em;
  animation: viewIn 0.9s 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero-stats {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--bone-faint);
  letter-spacing: 0.14em;
  animation: viewIn 0.9s 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero-stats b {
  color: var(--gold);
  font-weight: 600;
}

/* 测试卡片 */
.test-cards {
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.test-card {
  position: relative;
  border: 1px solid rgba(201, 168, 106, 0.2);
  background: linear-gradient(
    160deg,
    rgba(29, 23, 41, 0.85),
    rgba(12, 9, 16, 0.92)
  );
  padding: 40px 32px 34px;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.45s,
    box-shadow 0.45s;
  animation: viewIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.test-card:nth-child(1) {
  animation-delay: 0.6s;
}
.test-card:nth-child(2) {
  animation-delay: 0.72s;
}
.test-card:nth-child(3) {
  animation-delay: 0.84s;
}
.test-card::before,
.test-card::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.55;
  transition:
    width 0.4s,
    height 0.4s,
    opacity 0.4s;
}
.test-card::before {
  top: 8px;
  left: 8px;
  border-width: 1px 0 0 1px;
}
.test-card::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 1px 1px 0;
}
.test-card:hover {
  transform: translateY(-8px);
  border-color: rgba(201, 168, 106, 0.55);
  box-shadow:
    0 24px 60px -18px rgba(193, 18, 31, 0.35),
    0 0 0 1px rgba(193, 18, 31, 0.15);
}
.test-card:hover::before,
.test-card:hover::after {
  width: 46px;
  height: 46px;
  opacity: 1;
}
.test-card .card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% -20%,
    rgba(193, 18, 31, 0.22),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.5s;
}
.test-card:hover .card-glow {
  opacity: 1;
}
.card-numeral {
  font-family: var(--roman);
  font-size: 52px;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 168, 106, 0.55);
  line-height: 1;
  margin-bottom: 20px;
}
.test-card h3 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.test-card .card-sub {
  font-family: var(--roman);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: var(--crimson-glow);
  margin-bottom: 18px;
}
.test-card .card-desc {
  font-size: 14px;
  line-height: 1.95;
  color: var(--bone-dim);
  min-height: 84px;
}
.card-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed rgba(201, 168, 106, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--bone-faint);
  letter-spacing: 0.1em;
}
.card-foot .enter {
  color: var(--gold);
  transition: transform 0.35s;
}
.test-card:hover .enter {
  transform: translateX(6px);
  color: var(--gold-bright);
}
.card-done {
  display: inline-block;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--virtue);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
}

.home-note {
  margin-top: clamp(48px, 7vw, 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  color: var(--bone-faint);
  font-size: 12.5px;
  line-height: 2;
  letter-spacing: 0.08em;
}
.home-note .rule {
  color: var(--crimson);
  font-size: 14px;
}

/* ---------- 答题页 ---------- */
.view-quiz {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 60px) clamp(18px, 4vw, 48px);
}
.quiz-frame {
  border: 1px solid rgba(201, 168, 106, 0.22);
  background: linear-gradient(
    165deg,
    rgba(29, 23, 41, 0.7),
    rgba(11, 9, 15, 0.9)
  );
  padding: clamp(24px, 4vw, 52px);
  position: relative;
}
.quiz-frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(201, 168, 106, 0.1);
  pointer-events: none;
}
.quiz-head {
  position: relative;
  z-index: 1;
  margin-bottom: 34px;
}
.ghost-btn {
  background: none;
  border: none;
  color: var(--bone-faint);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.3s;
}
.ghost-btn:hover {
  color: var(--crimson-glow);
}
.quiz-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 16px 0 12px;
  font-size: 13px;
  color: var(--bone-dim);
  letter-spacing: 0.18em;
}
.quiz-counter b {
  font-family: var(--roman);
  color: var(--gold);
  font-size: 20px;
}
.quiz-counter i {
  font-family: var(--roman);
  font-style: normal;
  color: var(--bone-faint);
}
.quiz-progress {
  height: 3px;
  background: rgba(201, 168, 106, 0.12);
  overflow: hidden;
}
.quiz-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--crimson), var(--gold));
  box-shadow: 0 0 12px rgba(193, 18, 31, 0.6);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.quiz-stage {
  position: relative;
  z-index: 1;
  text-align: center;
}
.quiz-stage.slide-out {
  animation: qOut 0.28s ease both;
}
.quiz-stage.slide-in {
  animation: qIn 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes qOut {
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}
@keyframes qIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
}
.quiz-roman {
  font-family: var(--roman);
  font-size: 15px;
  letter-spacing: 0.6em;
  color: var(--crimson-glow);
  margin-bottom: 20px;
}
.quiz-question {
  font-size: clamp(20px, 3.2vw, 27px);
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: 0.04em;
  max-width: 620px;
  margin: 0 auto 40px;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-options {
  display: grid;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}
.quiz-option {
  position: relative;
  border: 1px solid rgba(201, 168, 106, 0.2);
  background: rgba(20, 16, 28, 0.5);
  color: var(--bone-dim);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.08em;
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.quiz-option:hover {
  border-color: var(--gold);
  color: var(--bone);
  background: rgba(201, 168, 106, 0.08);
  transform: translateX(6px);
}
.quiz-option.picked {
  border-color: var(--crimson);
  color: var(--bone);
  background: rgba(193, 18, 31, 0.14);
  box-shadow: 0 0 24px rgba(193, 18, 31, 0.2);
}
.quiz-option .opt-key {
  font-family: var(--roman);
  font-size: 11px;
  color: var(--gold);
  margin-right: 12px;
  letter-spacing: 0.1em;
}

/* ---------- 结果页通用 ---------- */
.view-result {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 60px) clamp(18px, 4vw, 48px);
}
.shared-banner {
  text-align: center;
  font-size: 13.5px;
  letter-spacing: 0.1em;
  color: var(--gold);
  border: 1px dashed rgba(201, 168, 106, 0.4);
  padding: 12px 18px;
  margin-bottom: 30px;
  background: rgba(201, 168, 106, 0.05);
}
.shared-banner a {
  color: var(--crimson-glow);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 46, 62, 0.4);
}

.result-head {
  text-align: center;
  margin-bottom: 40px;
}
.result-eyebrow {
  font-family: var(--roman);
  font-size: 11px;
  letter-spacing: 0.5em;
  color: var(--crimson-glow);
  margin-bottom: 16px;
}
.result-title {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 900;
  letter-spacing: 0.1em;
}
.result-subtitle {
  margin-top: 12px;
  color: var(--bone-dim);
  font-size: 14.5px;
  letter-spacing: 0.12em;
  line-height: 1.9;
}

.panel {
  border: 1px solid rgba(201, 168, 106, 0.22);
  background: linear-gradient(
    165deg,
    rgba(29, 23, 41, 0.7),
    rgba(11, 9, 15, 0.88)
  );
  padding: clamp(22px, 4vw, 40px);
  margin-bottom: 28px;
  position: relative;
}
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: rgba(201, 168, 106, 0.5);
  border-style: solid;
}
.panel::before {
  top: 6px;
  left: 6px;
  border-width: 1px 0 0 1px;
}
.panel::after {
  bottom: 6px;
  right: 6px;
  border-width: 0 1px 1px 0;
}
.panel-title {
  font-size: 15px;
  letter-spacing: 0.3em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.panel-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 168, 106, 0.35), transparent);
}

/* 雷达图 */
.radar-wrap {
  display: flex;
  justify-content: center;
}
.radar-wrap canvas {
  max-width: 100%;
  height: auto;
}

.radar-legend {
  margin-top: 26px;
  display: grid;
  gap: 10px;
}
.axis-row {
  display: grid;
  grid-template-columns: 34px 1fr 46px;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  letter-spacing: 0.06em;
}
.axis-roman {
  font-family: var(--roman);
  color: var(--bone-faint);
  font-size: 11px;
}
.axis-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}
.axis-sin {
  color: var(--sin);
}
.axis-virtue {
  color: var(--virtue);
}
.axis-bar {
  height: 6px;
  background: rgba(201, 168, 106, 0.1);
  position: relative;
  overflow: hidden;
}
.axis-bar .zero {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(233, 225, 210, 0.25);
}
.axis-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.axis-fill.to-virtue {
  left: 50%;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.35), var(--virtue));
}
.axis-fill.to-sin {
  right: 50%;
  background: linear-gradient(270deg, rgba(179, 35, 58, 0.35), var(--sin));
}
.axis-value {
  font-family: var(--roman);
  font-size: 12px;
  color: var(--bone-dim);
  text-align: right;
}

/* 英雄技能图 */
.hero-sheet {
  text-align: center;
  margin-bottom: 8px;
}
.hero-class-prefix {
  font-size: 15px;
  color: var(--sin);
  letter-spacing: 0.4em;
  margin-bottom: 8px;
}
.hero-class-name {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 900;
  color: var(--gold-bright);
  letter-spacing: 0.16em;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}
.hero-verdict {
  margin-top: 14px;
  color: var(--bone-dim);
  font-size: 14px;
  line-height: 2;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.skill-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 28px;
}
.skill-card {
  border: 1px solid rgba(201, 168, 106, 0.18);
  background: rgba(20, 16, 28, 0.55);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.35s,
    border-color 0.35s,
    box-shadow 0.35s;
  animation: viewIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.skill-card:hover {
  transform: translateY(-4px);
}
.skill-card.virtue-skill {
  border-left: 3px solid var(--virtue);
}
.skill-card.virtue-skill:hover {
  box-shadow: 0 12px 34px -10px rgba(212, 175, 55, 0.3);
  border-color: rgba(212, 175, 55, 0.5);
}
.skill-card.sin-skill {
  border-left: 3px solid var(--sin);
}
.skill-card.sin-skill:hover {
  box-shadow: 0 12px 34px -10px rgba(179, 35, 58, 0.35);
  border-color: rgba(179, 35, 58, 0.55);
}
.skill-slot {
  font-family: var(--roman);
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--bone-faint);
  margin-bottom: 10px;
}
.skill-card.virtue-skill .skill-slot {
  color: rgba(212, 175, 55, 0.75);
}
.skill-card.sin-skill .skill-slot {
  color: rgba(255, 46, 62, 0.6);
}
.skill-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}
.skill-desc {
  font-size: 13px;
  line-height: 1.9;
  color: var(--bone-dim);
}
.skill-power {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-family: var(--roman);
  letter-spacing: 0.2em;
  color: var(--bone-faint);
}
.power-pips {
  display: flex;
  gap: 4px;
}
.pip {
  width: 14px;
  height: 4px;
  background: rgba(201, 168, 106, 0.15);
}
.pip.on {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201, 168, 106, 0.6);
}
.sin-skill .pip.on {
  background: var(--crimson-glow);
  box-shadow: 0 0 8px rgba(255, 46, 62, 0.6);
}

/* 维度条 (MBTI) */
.dich-list {
  display: grid;
  gap: 26px;
}
.dich-row {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  gap: 16px;
  align-items: center;
}
.dich-side {
  text-align: center;
  font-size: 13.5px;
  color: var(--bone-faint);
  letter-spacing: 0.08em;
}
.dich-side b {
  display: block;
  font-family: var(--roman);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}
.dich-side.win {
  color: var(--bone);
}
.dich-side.win b {
  color: var(--gold-bright);
  text-shadow: 0 0 14px rgba(212, 175, 55, 0.4);
}
.dich-track {
  height: 8px;
  background: rgba(201, 168, 106, 0.1);
  position: relative;
}
.dich-track .mid {
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: rgba(233, 225, 210, 0.25);
}
.dich-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--crimson), var(--gold));
  box-shadow: 0 0 14px rgba(193, 18, 31, 0.4);
  transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dich-pct {
  text-align: center;
  margin-top: 7px;
  font-family: var(--roman);
  font-size: 11px;
  color: var(--bone-faint);
  letter-spacing: 0.14em;
}

.type-badge {
  display: inline-flex;
  gap: 6px;
  margin: 18px 0 6px;
}
.type-letter {
  font-family: var(--roman);
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 900;
  width: 1.35em;
  text-align: center;
  border: 1px solid rgba(201, 168, 106, 0.35);
  background: rgba(201, 168, 106, 0.06);
  padding: 6px 0 2px;
  color: var(--gold-bright);
  animation: letterIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.type-letter:nth-child(2) {
  animation-delay: 0.1s;
}
.type-letter:nth-child(3) {
  animation-delay: 0.2s;
}
.type-letter:nth-child(4) {
  animation-delay: 0.3s;
}
@keyframes letterIn {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(-4deg);
  }
}

/* 光谱 (Kinsey) */
.spectrum {
  position: relative;
  padding: 46px 8px 60px;
}
.spectrum-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #5b8def,
    #7ec8a9,
    #c9a86a,
    #e0708a,
    #c1121f
  );
  position: relative;
  box-shadow: 0 0 24px rgba(193, 18, 31, 0.25);
}
.spectrum-marker {
  position: absolute;
  top: 50%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bone);
  border: 3px solid var(--ink);
  box-shadow:
    0 0 0 2px var(--gold),
    0 0 26px rgba(236, 217, 168, 0.7);
  transform: translate(-50%, -50%);
  transition: left 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.spectrum-marker::after {
  content: "你";
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
}
.spectrum-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
}
.spectrum-ticks span {
  font-family: var(--roman);
  font-size: 11px;
  color: var(--bone-faint);
  width: 40px;
  text-align: center;
}
.spectrum-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--bone-dim);
  letter-spacing: 0.1em;
}

/* 分享区 */
.share-panel {
  text-align: center;
}
.share-link-box {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto 16px;
}
.share-link-box input {
  flex: 1;
  min-width: 0;
  background: rgba(11, 9, 15, 0.8);
  border: 1px solid rgba(201, 168, 106, 0.25);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 13px;
  padding: 13px 16px;
  letter-spacing: 0.03em;
  outline: none;
}
.share-link-box input:focus {
  border-color: var(--gold);
}
.btn {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.16em;
  padding: 13px 26px;
  cursor: pointer;
  border: 1px solid var(--crimson);
  background: linear-gradient(
    150deg,
    rgba(193, 18, 31, 0.9),
    rgba(120, 10, 20, 0.9)
  );
  color: var(--bone);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}
.btn:hover {
  box-shadow: 0 0 28px rgba(193, 18, 31, 0.45);
  transform: translateY(-2px);
}
.btn.gold {
  border-color: rgba(201, 168, 106, 0.5);
  background: linear-gradient(
    150deg,
    rgba(201, 168, 106, 0.16),
    rgba(201, 168, 106, 0.05)
  );
  color: var(--gold-bright);
}
.btn.gold:hover {
  box-shadow: 0 0 28px rgba(201, 168, 106, 0.25);
}
.btn.ghost {
  border-color: rgba(233, 225, 210, 0.18);
  background: none;
  color: var(--bone-dim);
}
.btn.ghost:hover {
  color: var(--bone);
  border-color: rgba(233, 225, 210, 0.4);
  box-shadow: none;
}
.share-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.share-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--bone-faint);
  letter-spacing: 0.08em;
}

/* 页脚 */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 34px 20px 40px;
  border-top: 1px solid rgba(201, 168, 106, 0.12);
  color: var(--bone-faint);
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 2;
}

/* 页头商务入口(轻量一行小字) */
.header-biz {
  margin-left: auto;
  margin-right: 14px;
  font-size: 12px;
  color: var(--bone-faint);
  letter-spacing: 0.12em;
  text-decoration: none;
  border-bottom: 1px dashed rgba(201, 168, 106, 0.35);
  padding-bottom: 2px;
  transition:
    color 0.3s,
    border-color 0.3s;
  white-space: nowrap;
}
.header-biz:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* 页脚商务合作区 */
.biz-area {
  margin: 22px auto 6px;
  max-width: 560px;
  border: 1px dashed rgba(201, 168, 106, 0.3);
  background: rgba(20, 16, 28, 0.45);
  padding: 22px 24px 20px;
}
.biz-title {
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 10px;
}
.biz-desc {
  font-size: 12.5px;
  color: var(--bone-dim);
  letter-spacing: 0.06em;
  line-height: 1.9;
}
.biz-tags {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.biz-tags span {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--bone-faint);
  border: 1px solid rgba(201, 168, 106, 0.22);
  padding: 3px 10px;
  border-radius: 999px;
}
.biz-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.biz-links a {
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition:
    color 0.3s,
    border-color 0.3s;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.biz-mail {
  color: var(--gold);
  border-color: rgba(201, 168, 106, 0.4);
}
.biz-mail:hover {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
}
.biz-main {
  color: var(--crimson-glow);
  border-color: rgba(255, 46, 62, 0.35);
}
.biz-main:hover {
  border-color: var(--crimson-glow);
}
.footer-author {
  margin-top: 18px;
  font-size: 12px;
  color: var(--bone-faint);
  letter-spacing: 0.1em;
}
.site-stats {
  margin-top: 20px;
  font-size: 12.5px;
  color: var(--bone-dim);
  letter-spacing: 0.14em;
}
.site-stats b {
  color: var(--gold);
  font-weight: 700;
  margin: 0 2px;
}
.footer-author a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 168, 106, 0.3);
  padding-bottom: 1px;
  transition: color 0.3s;
}
.footer-author a:hover {
  color: var(--gold-bright);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: rgba(20, 16, 28, 0.95);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  font-size: 13.5px;
  letter-spacing: 0.12em;
  padding: 13px 28px;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 仪表盘 (指数型试炼) */
.gauge {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.gauge-number {
  font-family: var(--roman);
  font-size: clamp(56px, 10vw, 84px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 34px currentColor;
}
.gauge-number small {
  font-size: 0.28em;
  font-weight: 400;
  color: var(--bone-faint);
  margin-left: 6px;
  letter-spacing: 0.1em;
}
.gauge-track {
  position: relative;
  height: 12px;
  margin: 26px 4px 0;
  background: rgba(201, 168, 106, 0.1);
  border-radius: 999px;
}
.gauge-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(193, 18, 31, 0.35);
}
.gauge-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bone);
  border: 3px solid var(--ink);
  box-shadow:
    0 0 0 2px var(--gold),
    0 0 22px rgba(236, 217, 168, 0.6);
  transform: translate(-50%, -50%);
}
.gauge-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--bone-faint);
  letter-spacing: 0.1em;
}

.subscale-list {
  margin-top: 30px;
  display: grid;
  gap: 14px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.subscale-row {
  display: grid;
  grid-template-columns: 52px 1fr 40px;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
  letter-spacing: 0.1em;
}
.subscale-name {
  color: var(--bone-dim);
}
.subscale-track {
  height: 8px;
  background: rgba(201, 168, 106, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.subscale-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.subscale-value {
  font-family: var(--roman);
  font-size: 13px;
  text-align: right;
}

/* ---------- 触屏基础优化 ---------- */
body {
  -webkit-tap-highlight-color: transparent;
}
.quiz-option,
.btn,
.test-card,
.ghost-btn {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.quiz-option:active {
  border-color: var(--gold);
  color: var(--bone);
  background: rgba(201, 168, 106, 0.12);
  transform: scale(0.985);
}
.btn:active {
  transform: scale(0.97);
}
input {
  font-size: 16px; /* 防止 iOS 聚焦自动放大 */
}

/* ---------- 移动端 (≤640px) ---------- */
@media (max-width: 640px) {
  .site-header {
    padding: 14px 16px;
    gap: 10px;
  }
  .brand-text {
    font-size: 15px;
  }
  .brand-text em {
    font-size: 8px;
  }
  .brand-sigil {
    font-size: 22px;
  }
  .cookie-badge {
    font-size: 11px;
    padding: 6px 11px;
    max-width: 52vw;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .header-biz {
    display: none; /* 移动端收纳,完整合作区保留在页脚 */
  }
  .biz-area {
    padding: 18px 14px 16px;
  }
  .biz-links {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .view-home {
    padding-top: 40px;
  }
  .hero {
    margin-bottom: 40px;
  }
  .hero-sub {
    line-height: 1.9;
  }
  .hero-sub br {
    display: none; /* 手机上让文案自然折行 */
  }
  .test-cards {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .test-card {
    padding: 28px 22px 24px;
  }
  .card-numeral {
    font-size: 40px;
    margin-bottom: 12px;
  }
  .test-card h3 {
    font-size: 21px;
  }
  .test-card .card-desc {
    min-height: 0;
  }
  .home-note {
    gap: 12px;
  }

  /* 答题页:大触控目标 */
  .view-quiz {
    padding: 18px 12px;
  }
  .quiz-frame {
    padding: 20px 16px 26px;
  }
  .quiz-frame::before {
    inset: 6px;
  }
  .quiz-head {
    margin-bottom: 24px;
  }
  .quiz-roman {
    font-size: 13px;
    margin-bottom: 14px;
  }
  .quiz-question {
    font-size: 19px;
    min-height: 84px;
    margin-bottom: 26px;
    padding: 0 4px;
  }
  .quiz-options {
    gap: 10px;
  }
  .quiz-option {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    font-size: 15.5px;
  }
  .quiz-option:hover {
    transform: none; /* 触屏无悬停,避免残影 */
  }

  /* 结果页 */
  .view-result {
    padding: 22px 12px;
  }
  .result-head {
    margin-bottom: 26px;
  }
  .result-subtitle {
    font-size: 13.5px;
    padding: 0 6px;
  }
  .panel {
    padding: 20px 16px 24px;
    margin-bottom: 20px;
  }
  .panel-title {
    font-size: 13px;
    letter-spacing: 0.22em;
  }

  .axis-row {
    grid-template-columns: 24px 1fr 38px;
    gap: 10px;
    font-size: 12.5px;
  }
  .skill-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dich-row {
    grid-template-columns: 48px 1fr 48px;
    gap: 10px;
  }
  .dich-side {
    font-size: 11.5px;
  }
  .dich-side b {
    font-size: 18px;
  }
  .type-letter {
    font-size: 34px;
  }

  .spectrum {
    padding: 40px 2px 50px;
  }
  .spectrum-ticks span {
    font-size: 10px;
    width: 28px;
  }
  .spectrum-ends {
    font-size: 11px;
  }

  .gauge-track {
    height: 14px;
  }
  .subscale-row {
    grid-template-columns: 46px 1fr 36px;
    gap: 10px;
    font-size: 12.5px;
  }

  .share-link-box {
    flex-direction: column;
  }
  .share-link-box .btn {
    width: 100%;
  }
  .share-actions .btn {
    flex: 1 1 100%;
    padding: 14px 20px;
  }

  .site-footer {
    padding: 26px 16px calc(30px + env(safe-area-inset-bottom));
    font-size: 11px;
  }
  .toast {
    bottom: calc(22px + env(safe-area-inset-bottom));
    max-width: 86vw;
    text-align: center;
  }
}

/* ---------- 超小屏 (≤360px) ---------- */
@media (max-width: 360px) {
  .cookie-badge {
    max-width: 44vw;
  }
  .quiz-question {
    font-size: 17.5px;
  }
  .hero-title {
    letter-spacing: 0.03em;
  }
}

/* ---------- 减少动态效果偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain,
  .ember {
    animation: none !important;
  }
  .view,
  .test-card,
  .skill-card,
  .type-letter {
    animation-duration: 0.01s !important;
  }
  .quiz-stage.slide-out,
  .quiz-stage.slide-in {
    animation-duration: 0.01s !important;
  }
}
