:root {
  --bg-dark: #0f1021;
  --card-bg: rgba(25, 27, 49, 0.86);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f6f7fb;
  --text-muted: #a6aac8;
  --male-color: #4f9cff;
  --male-glow: rgba(79, 156, 255, 0.35);
  --female-color: #ff6ba9;
  --female-glow: rgba(255, 107, 169, 0.35);
  --egg-color: #b77cff;
  --egg-glow: rgba(183, 124, 255, 0.4);
  --radius-lg: 24px;
  --radius-md: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  overflow-x: hidden;
  position: relative;
}

/* 背景氛围光球 */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  z-index: 0;
  pointer-events: none;
  animation: floatOrb 12s ease-in-out infinite alternate;
}

.orb-1 {
  width: 320px;
  height: 320px;
  background: #3b82f6;
  top: -80px;
  left: -80px;
}

.orb-2 {
  width: 340px;
  height: 340px;
  background: #ec4899;
  bottom: -100px;
  right: -80px;
  animation-delay: -4s;
}

.orb-3 {
  width: 240px;
  height: 240px;
  background: #8b5cf6;
  top: 45%;
  left: 55%;
  opacity: 0.25;
  animation-delay: -8s;
}

@keyframes floatOrb {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(24px, -24px) scale(1.08);
  }
}

.app-shell {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.screen {
  display: none;
  animation: fadeSlideIn 0.35s ease forwards;
}

.screen.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* 首页 */
.start-card {
  text-align: center;
}

.badge-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d6daff;
  margin-bottom: 18px;
}

.hero-emoji {
  font-size: 56px;
  margin-bottom: 10px;
  animation: pulseSoft 2.8s ease-in-out infinite;
}

@keyframes pulseSoft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.start-card h1 {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 800;
  margin-bottom: 14px;
}

.gradient-text {
  background: linear-gradient(135deg, #60a5fa 0%, #f472b6 55%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hint-text {
  color: #c4b5fd;
  font-size: 13px;
}

.preview-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 26px;
}

.preview-chips span {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d7daf0;
}

/* 按钮 */
.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: transform 0.16s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

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

.btn-primary {
  width: 100%;
  padding: 15px 20px;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(135deg, #4f9cff 0%, #ec4899 100%);
  box-shadow: 0 10px 26px rgba(236, 72, 153, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 12px 30px rgba(79, 156, 255, 0.4);
}

.btn-secondary {
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 10px;
}

.btn-ghost:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.footer-note {
  margin-top: 14px;
  font-size: 12px;
  color: rgba(166, 170, 200, 0.65);
}

/* 答题页 */
.quiz-header {
  margin-bottom: 22px;
}

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

.q-counter {
  font-size: 13px;
  font-weight: 700;
  color: #d6daff;
}

.q-tag {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, #4f9cff, #ff6ba9);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.question-box {
  min-height: 310px;
}

.q-title {
  font-size: 18.5px;
  line-height: 1.5;
  font-weight: 700;
  margin-bottom: 18px;
}

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

.option-btn {
  width: 100%;
  text-align: left;
  padding: 14px 15px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: all 0.18s ease;
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.option-btn.selected {
  background: linear-gradient(135deg, rgba(79, 156, 255, 0.24), rgba(255, 107, 169, 0.24));
  border-color: #f472b6;
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.4);
}

.opt-letter {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

.quiz-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tap-tip {
  font-size: 12px;
  color: rgba(166, 170, 200, 0.6);
}

/* 加载页 */
.loading-card {
  text-align: center;
  padding: 48px 24px;
}

.scanner-ring {
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #4f9cff;
  border-right-color: #ff6ba9;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 1s linear infinite;
}

.scanner-core {
  font-size: 34px;
  animation: spinReverse 1s linear infinite;
}

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

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

.loading-card h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.loading-status {
  font-size: 14px;
  color: var(--text-muted);
}

/* 结果页 */
.result-card.theme-male {
  border-color: rgba(79, 156, 255, 0.4);
  box-shadow: 0 24px 60px var(--male-glow);
}

.result-card.theme-female {
  border-color: rgba(255, 107, 169, 0.4);
  box-shadow: 0 24px 60px var(--female-glow);
}

.result-card.theme-egg {
  border-color: rgba(183, 124, 255, 0.55);
  box-shadow: 0 24px 60px var(--egg-glow);
  background: linear-gradient(160deg, rgba(35, 22, 62, 0.92), rgba(20, 24, 48, 0.92));
}

.result-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.report-id {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.rarity-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.theme-egg .rarity-badge {
  background: linear-gradient(90deg, #a855f7, #ec4899);
  color: #fff;
}

.result-hero {
  text-align: center;
  margin-bottom: 20px;
}

.result-emoji {
  font-size: 52px;
  margin-bottom: 6px;
}

.result-label-small {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-gender {
  font-size: 46px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 6px;
}

.theme-male .result-gender {
  color: #70b2ff;
}

.theme-female .result-gender {
  color: #ff85b8;
}

.theme-egg .result-gender {
  font-size: 32px;
  background: linear-gradient(90deg, #c084fc, #f472b6, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.theme-male .result-sub {
  background: rgba(79, 156, 255, 0.16);
  border-color: rgba(79, 156, 255, 0.4);
  color: #a8d0ff;
}

.theme-female .result-sub {
  background: rgba(255, 107, 169, 0.16);
  border-color: rgba(255, 107, 169, 0.4);
  color: #ffb3d3;
}

.theme-egg .result-sub {
  background: rgba(183, 124, 255, 0.2);
  border-color: rgba(183, 124, 255, 0.45);
  color: #e2c6ff;
}

/* 浓度条 */
.meter-section {
  margin-bottom: 20px;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.m-label { color: #8ec1ff; }
.f-label { color: #ff98c4; }

.meter-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  background: rgba(255, 255, 255, 0.08);
}

.meter-male {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.6s ease;
}

.meter-female {
  background: linear-gradient(90deg, #f472b6, #ec4899);
  transition: width 0.6s ease;
}

/* 人设锐评框 */
.persona-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.persona-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
}

.persona-desc {
  font-size: 14px;
  line-height: 1.68;
  color: #d5d8ec;
  margin-bottom: 12px;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result-tags span {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #c7cbeb;
}

.share-tip {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.result-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
}

.copy-toast {
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  color: #86efac;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.copy-toast.show {
  opacity: 1;
}
