/* ============================================================
 * 测测你的本命水晶 — 样式（移动端优先，微信内置浏览器可用）
 * ============================================================ */

:root {
  --bg1: #1a1633;
  --bg2: #0f0d1f;
  --card: #ffffff;
  --ink: #2b2940;
  --sub: #8a87a3;
  --accent: #7c63b8;
  --accent-deep: #5b47a0;
  --line: #e7e4f2;
}

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

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(1100px 750px at 85% -10%, #2c2350 0%, transparent 58%),
    radial-gradient(900px 700px at -15% 35%, #251c42 0%, transparent 55%),
    radial-gradient(800px 600px at 110% 85%, #211a3c 0%, transparent 50%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
  background-attachment: fixed;
}

/* 星星点缀 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 12% 18%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(2px 2px at 68% 9%, rgba(255,255,255,.55) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 36% 31%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(2px 2px at 88% 36%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 52%, rgba(255,255,255,.4) 50%, transparent 51%),
    radial-gradient(2px 2px at 8% 62%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 76% 74%, rgba(255,255,255,.45) 50%, transparent 51%),
    radial-gradient(2px 2px at 28% 84%, rgba(255,255,255,.5) 50%, transparent 51%);
  z-index: 0;
}

#app { position: relative; z-index: 1; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.hidden { display: none !important; }

/* ---------- 通用按钮 ---------- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 17px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(124, 99, 184, .4);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary:active { transform: scale(.97); box-shadow: 0 4px 12px rgba(124, 99, 184, .35); }

.btn-ghost {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--sub);
  font-size: 15px;
  cursor: pointer;
}
.btn-ghost:active { background: rgba(255,255,255,.08); }

/* ---------- 开始页 ---------- */
.start-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
}
.start-emoji { font-size: 76px; animation: float 3.4s ease-in-out infinite; }
.start-title {
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 4px;
  text-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.start-sub { color: rgba(255,255,255,.92); font-size: 19px; margin-top: 8px; }
.start-sub2 { color: rgba(255,255,255,.62); font-size: 14px; letter-spacing: 1px; }
.start-wrap .btn-primary { margin-top: 34px; }
.start-wrap .disclaimer { margin-top: 34px; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ---------- 题目页 ---------- */
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.back-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 0;
}
.back-btn.ghost { color: rgba(255,255,255,.5); font-weight: 600; letter-spacing: 1px; cursor: default; }
.quiz-count { color: rgba(255,255,255,.6); font-size: 13px; letter-spacing: 1px; }

.progress {
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  overflow: hidden;
  margin-bottom: 22px;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #a58fe0);
  transition: width .3s ease;
}

.q-card {
  background: var(--card);
  border-radius: 24px;
  padding: 28px 22px 26px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .3);
  animation: fadeUp .35s ease;
}
.q-title { font-size: 23px; font-weight: 800; line-height: 1.35; }
.q-sub { color: var(--sub); font-size: 14px; margin-top: 8px; }
.q-options { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }

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

/* 选项按钮 */
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
  animation: fadeUp .3s ease backwards;
}
.opt:nth-child(2) { animation-delay: .04s; }
.opt:nth-child(3) { animation-delay: .08s; }
.opt:nth-child(4) { animation-delay: .12s; }
.opt:nth-child(5) { animation-delay: .16s; }
.opt:nth-child(6) { animation-delay: .2s; }
.opt:active { transform: scale(.98); }
.opt.sel {
  border-color: var(--accent);
  background: #f3effc;
  color: var(--accent-deep);
  font-weight: 700;
}
.opt-emoji { font-size: 24px; }
.opt-emoji.big { font-size: 30px; }

/* 色块 */
.color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.color-item {
  aspect-ratio: 1;
  border: 3px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .14);
  animation: fadeUp .3s ease backwards;
}
.color-item:nth-child(2) { animation-delay: .03s; }
.color-item:nth-child(3) { animation-delay: .06s; }
.color-item:nth-child(4) { animation-delay: .09s; }
.color-item:nth-child(5) { animation-delay: .12s; }
.color-item:nth-child(6) { animation-delay: .15s; }
.color-item:nth-child(7) { animation-delay: .18s; }
.color-item:nth-child(8) { animation-delay: .21s; }
.color-item:nth-child(9) { animation-delay: .24s; }
.color-item:active { transform: scale(.93); }
.color-item.sel {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 4px rgba(124, 99, 184, .35), 0 6px 16px rgba(0, 0, 0, .14);
}
.color-item span {
  font-size: 13px;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
/* 白色、黄色色块上的文字用深色 */
.color-item[data-value="white"] span,
.color-item[data-value="yellow"] span { color: rgba(40, 36, 60, .8); text-shadow: none; }

/* emoji 题 */
.emoji-opt { justify-content: flex-start; }

/* 日期输入 */
.date-input {
  width: 100%;
  padding: 18px 16px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  font-size: 18px;
  color: var(--ink);
  background: #fff;
  font-family: inherit;
}
.date-input:focus { outline: none; border-color: var(--accent); }
.q-error { color: #c65f5f; font-size: 13px; margin-top: 10px; }

/* 时辰 */
.hour-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.hour-opt { justify-content: center; font-size: 15px; padding: 13px 10px; }
.hour-special { justify-content: center; font-size: 15px; }

/* ---------- 结果页 ---------- */
.result-header {
  border-radius: 0 0 30px 30px;
  padding: 40px 22px 44px;
  text-align: center;
  color: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
  animation: fadeUp .4s ease;
}
.rh-kicker { font-size: 14px; letter-spacing: 3px; opacity: .9; }
.rh-title {
  font-size: 30px;
  font-weight: 900;
  margin-top: 16px;
  line-height: 1.35;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .22);
}
.rh-quote { margin-top: 14px; font-size: 15px; opacity: .92; line-height: 1.6; }
.rh-sub {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
}

.card {
  background: var(--card);
  border-radius: 22px;
  padding: 24px 20px;
  margin-top: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  animation: fadeUp .4s ease backwards;
}
.card:nth-of-type(2) { animation-delay: .06s; }
.card:nth-of-type(3) { animation-delay: .12s; }
.card:nth-of-type(4) { animation-delay: .18s; }

.stones-card { margin-top: -26px; }

.card-title { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.card-p { font-size: 15px; line-height: 1.7; color: #4c4966; margin-top: 8px; }

.wish-copy {
  font-size: 15px;
  line-height: 1.7;
  color: #4c4966;
  background: #f7f5fc;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

/* 石卡片 */
.stone-card {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.stone-card:last-of-type { border-bottom: none; }
.stone-dot {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}
.stone-info { flex: 1; min-width: 0; }
.stone-role { font-size: 12px; color: var(--accent-deep); font-weight: 700; letter-spacing: 1px; }
.stone-name { font-size: 17px; font-weight: 800; margin-top: 3px; }
.stone-charm { font-size: 13px; font-weight: 500; color: var(--sub); }
.stone-extra { font-size: 13px; color: #6b6890; line-height: 1.6; margin-top: 6px; }
.stone-effect { font-size: 14px; color: #4c4966; line-height: 1.65; margin-top: 6px; }
.stone-tip { font-size: 12.5px; color: #9a97b5; margin-top: 6px; }
.dup-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f5fc;
  color: var(--accent-deep);
  font-size: 13.5px;
  line-height: 1.6;
}

/* 八字卡 */
.bazi-gz { font-size: 19px; font-weight: 800; letter-spacing: 2px; }
.bazi-counts { font-size: 14px; color: #6b6890; margin-top: 8px; letter-spacing: 1px; }
.bazi-desc { font-size: 14.5px; color: #4c4966; line-height: 1.7; margin-top: 10px; }
.bazi-weak {
  font-size: 14.5px;
  color: var(--accent-deep);
  line-height: 1.7;
  margin-top: 8px;
  padding: 12px 14px;
  background: #f7f5fc;
  border-radius: 12px;
}

.bracelet-alt { font-size: 13.5px; color: #6b6890; line-height: 1.6; margin-top: 10px; }

/* 分享 */
.share-box { text-align: center; margin-top: 24px; }
.share-img {
  width: 100%;
  max-width: 380px;
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .4);
}
.share-hint { color: rgba(255, 255, 255, .65); font-size: 13px; margin: 12px 0 16px; letter-spacing: 1px; }

.result-note {
  color: rgba(255, 255, 255, .5);
  font-size: 12.5px;
  line-height: 1.7;
  margin-top: 16px;
  padding: 0 8px;
}

.disclaimer {
  color: rgba(255, 255, 255, .38);
  font-size: 11.5px;
  line-height: 1.7;
  margin-top: 26px;
  padding: 0 10px;
}
