/* ===== 豪意值检测 · 全局样式（对齐 mintryu.com：浅色纸面 + 粉蓝渐变 + 玻璃拟态） ===== */
:root {
  --paper: #fbfbff;
  --ink: #221c39;
  --ink-80: rgba(34, 28, 57, 0.8);
  --muted: #6b6286;
  --pink: #ff6fbd;
  --pink-deep: #e0449e;
  --blue: #35ccf1;
  --blue-deep: #0096c7;
  --line: rgba(48, 52, 92, 0.14);
  --glass: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42));
  --r-lg: 20px;
  --r-md: 14px;
  --shadow-1: 0 16px 44px rgba(43, 39, 75, 0.1);
  --shadow-2: 0 26px 64px rgba(43, 39, 75, 0.16);
  --font-display: "Space Grotesk", "Noto Sans SC", "PingFang SC", ui-sans-serif, sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 45% at 12% -5%, rgba(255, 111, 189, 0.18), transparent),
    radial-gradient(ellipse 70% 45% at 92% 105%, rgba(53, 204, 241, 0.16), transparent),
    linear-gradient(135deg, #fff 0%, var(--paper) 55%, #f8fbff 100%);
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--blue-deep);
  outline-offset: 3px;
  border-radius: 6px;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 40px;
  width: 100%;
}

.hidden {
  display: none !important;
}

h1,
.home-title,
.quiz-title,
.score-num,
.tier-name,
.quote {
  font-family: var(--font-display);
}

/* ===== 首页 ===== */
.home-inner {
  text-align: center;
  width: 100%;
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 20px rgba(43, 39, 75, 0.06), inset 0 1px 0 #fff;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.home-kicker .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--pink), var(--blue));
  box-shadow: 0 0 0 3px rgba(255, 111, 189, 0.18);
}

.home-title {
  font-size: clamp(40px, 11vw, 56px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--pink), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}

.home-desc {
  color: var(--muted);
  line-height: 1.9;
  font-size: 15px;
  margin-bottom: 32px;
}

.home-desc .hl {
  color: var(--blue-deep);
  font-weight: 600;
}

.home-formula {
  margin: 0 auto 28px;
  max-width: 360px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow-1), inset 0 1.5px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  text-align: left;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-80);
}

.home-formula b {
  color: var(--pink-deep);
  font-weight: 700;
}

.home-tip {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.home-foot {
  margin-top: 36px;
  font-size: 11px;
  color: #a79ec0;
  letter-spacing: 0.12em;
}

.home-foot a {
  color: var(--blue-deep);
  text-decoration: none;
  font-weight: 600;
}

.home-foot a:hover {
  text-decoration: underline;
}

/* ===== 按钮 ===== */
.btn-primary {
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  padding: 14px 44px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--pink), var(--blue));
  box-shadow: 0 8px 24px rgba(224, 68, 158, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.04);
  box-shadow: 0 12px 30px rgba(224, 68, 158, 0.34);
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 3px 12px rgba(224, 68, 158, 0.25);
}

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

.btn-ghost {
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
  padding: 12px 28px;
  border-radius: 999px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.95);
}

.btn-ghost:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.95);
}

.btn-ink {
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  padding: 12px 28px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(34, 28, 57, 0.22);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-ink:hover {
  filter: brightness(1.08);
}

.btn-ink:active {
  transform: scale(0.97);
}

/* ===== 答题页 ===== */
.quiz-inner {
  width: 100%;
  animation: slide-in 0.3s ease;
}

.quiz-inner.leaving {
  animation: slide-out 0.18s ease forwards;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slide-out {
  to {
    opacity: 0;
    transform: translateX(-28px);
  }
}

.progress-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(48, 52, 92, 0.1);
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pink), var(--blue));
  transition: width 0.25s ease;
}

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

.quiz-step {
  color: var(--muted);
  font-size: 13px;
}

.quiz-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--pink-deep);
  background: rgba(255, 111, 189, 0.14);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quiz-title {
  font-size: clamp(20px, 5.5vw, 24px);
  font-weight: 700;
  margin-bottom: 22px;
  letter-spacing: -0.01em;
  line-height: 1.45;
}

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

.option {
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  padding: 16px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 4px 16px rgba(48, 52, 92, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.option:hover {
  border-color: rgba(255, 111, 189, 0.45);
  box-shadow: 0 8px 24px rgba(255, 111, 189, 0.12), inset 0 1px 0 #fff;
}

.option:active {
  transform: scale(0.985);
  border-color: var(--pink);
  box-shadow: 0 4px 20px rgba(255, 111, 189, 0.25);
}

.option .opt-key {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  margin-top: 1px;
}

.option .opt-text {
  flex: 1;
  min-width: 0;
}

/* ===== 计算中 ===== */
.computing-inner {
  text-align: center;
}

.spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 4px solid rgba(255, 111, 189, 0.18);
  border-top-color: var(--pink);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.computing-text {
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--ink);
  font-weight: 600;
}

.computing-sub {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== 结果页 ===== */
#view-result {
  justify-content: flex-start;
  padding-top: 24px;
}

.result-card {
  width: 100%;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-2), inset 0 1.5px 0 #fff;
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

.result-hero {
  position: relative;
  padding: 28px 22px 22px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 111, 189, 0.28), transparent 42%),
    radial-gradient(circle at 18% 88%, rgba(53, 204, 241, 0.22), transparent 46%),
    linear-gradient(155deg, #f7f8ff 0%, #fff 55%, #f4fbff 100%);
}

.result-hero.accent-pink {
  background:
    radial-gradient(circle at 80% 10%, rgba(255, 111, 189, 0.4), transparent 40%),
    radial-gradient(circle at 15% 90%, rgba(255, 111, 189, 0.12), transparent 50%),
    linear-gradient(155deg, #fff5fb 0%, #fff 60%, #fdf2f8 100%);
}

.result-hero.accent-blue {
  background:
    radial-gradient(circle at 80% 10%, rgba(53, 204, 241, 0.32), transparent 40%),
    radial-gradient(circle at 15% 90%, rgba(53, 204, 241, 0.14), transparent 50%),
    linear-gradient(155deg, #f3fbff 0%, #fff 60%, #eef9ff 100%);
}

.result-hero.accent-ink {
  background:
    radial-gradient(circle at 70% 0%, rgba(255, 111, 189, 0.35), transparent 38%),
    radial-gradient(circle at 20% 100%, rgba(53, 204, 241, 0.28), transparent 42%),
    linear-gradient(155deg, #2b2340 0%, #221c39 55%, #1a1630 100%);
  color: #fff;
}

.result-hero.accent-ink .score-label,
.result-hero.accent-ink .tier-name {
  color: rgba(255, 255, 255, 0.92);
}

.result-hero.accent-ink .score-num {
  background: linear-gradient(120deg, #ff8fce, #6ee7ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.score-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 6px;
}

.score-num {
  font-size: clamp(64px, 18vw, 84px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, var(--pink), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

.score-unit {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 14px;
}

.result-hero.accent-ink .score-unit {
  color: rgba(255, 255, 255, 0.55);
}

.tier-name {
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tag {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(43, 39, 75, 0.06);
}

.result-hero.accent-ink .tag {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.result-body {
  padding: 22px 22px 18px;
}

.quote {
  font-size: clamp(16px, 4.2vw, 18px);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(255, 111, 189, 0.1), rgba(53, 204, 241, 0.1));
  border: 1px dashed var(--line);
}

.quote::before {
  content: "「";
  color: var(--pink-deep);
}

.quote::after {
  content: "」";
  color: var(--blue-deep);
}

.comment {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-80);
  margin-bottom: 16px;
}

.tip-box {
  font-size: 12.5px;
  line-height: 1.7;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(53, 204, 241, 0.28);
  background: rgba(53, 204, 241, 0.1);
  color: #0a6e8f;
}

.tip-box.warn {
  border-color: rgba(255, 111, 189, 0.28);
  background: rgba(255, 111, 189, 0.1);
  color: #b02a78;
}

.meter-block {
  margin-bottom: 16px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.meter-label strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--ink);
}

.meter-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(48, 52, 92, 0.08);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--blue));
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 12px rgba(255, 111, 189, 0.35);
}

.disclaimer {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.nihao {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.65;
  color: #a79ec0;
  font-style: italic;
}

.actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.actions-row {
  display: flex;
  gap: 10px;
}

.actions-row > * {
  flex: 1;
}

.share-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(34, 28, 57, 0.28);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: min(92vw, 360px);
  text-align: center;
  line-height: 1.45;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 弹层：豪到你了 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(34, 28, 57, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: min(360px, 100%);
  padding: 28px 24px 22px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-2);
  text-align: center;
  animation: pop-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 12px;
  background: linear-gradient(120deg, var(--pink), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-80);
  margin-bottom: 20px;
}

.modal .btn-primary {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
