* { box-sizing: border-box; }

:root {
  --pink: #ff7ebc;
  --hot: #ff4fa3;
  --blue: #82d7ff;
  --purple: #b18cff;
  --ink: #3c3152;
  --muted: #857895;
  --card: rgba(255, 255, 255, .78);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    linear-gradient(120deg, rgba(255, 126, 188, .18), transparent 30%),
    linear-gradient(240deg, rgba(130, 215, 255, .22), transparent 34%),
    radial-gradient(circle at 50% 110%, #ffe8f6 0%, transparent 40%),
    #fff8fd;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 126, 188, .18) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(130, 215, 255, .16) 1px, transparent 1.5px);
  background-size: 42px 42px, 58px 58px;
  background-position: 0 0, 18px 26px;
  pointer-events: none;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .55;
  animation: float 8s ease-in-out infinite;
}

.orb-a { width: 240px; height: 240px; left: -70px; top: 90px; background: #ffd0e8; }
.orb-b { width: 260px; height: 260px; right: -90px; top: 40px; background: #cdefff; animation-delay: -2s; }
.orb-c { width: 190px; height: 190px; right: 18%; bottom: -70px; background: #eadcff; animation-delay: -4s; }

.page { width: 100%; padding: 30px; position: relative; z-index: 1; }

.quiz-card {
  position: relative;
  max-width: 900px;
  min-height: 560px;
  margin: auto;
  padding: 38px;
  border-radius: 36px;
  background: var(--card);
  box-shadow: 0 30px 90px rgba(167, 102, 159, .22);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, .92);
  overflow: hidden;
}

.quiz-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(255, 126, 188, .24);
  border-radius: 28px;
  pointer-events: none;
}

.ribbon {
  position: absolute;
  right: -42px;
  top: 28px;
  width: 190px;
  transform: rotate(36deg);
  text-align: center;
  padding: 8px 0;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 10px 24px rgba(255, 126, 188, .25);
}

.top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.sub-title {
  margin: 0 0 8px;
  color: var(--hot);
  font-weight: 900;
  letter-spacing: 1.5px;
}

h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.1;
  color: var(--ink);
  text-shadow: 0 3px 0 rgba(255, 255, 255, .8);
}

.intro {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.counter {
  padding: 13px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--hot), var(--blue));
  color: white;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(255, 95, 170, .24);
  white-space: nowrap;
}

.decor-line {
  position: relative;
  z-index: 1;
  margin: 24px 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--pink);
  font-size: 18px;
  font-weight: 900;
}

.decor-line::before,
.decor-line::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(255, 126, 188, .45), transparent);
}

.progress-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 15px;
  margin: 0 0 30px;
  border-radius: 999px;
  background: rgba(255, 210, 235, .7);
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(180, 100, 150, .12);
}

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

.question-stage {
  position: relative;
  z-index: 1;
  min-height: 330px;
  overflow: hidden;
}

.question-box {
  position: relative;

  padding: 34px;

  border-radius: 30px;

  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,.96),
      rgba(255,244,251,.94)
    ),
    linear-gradient(
      135deg,
      rgba(255,126,188,.2),
      rgba(130,215,255,.2)
    );

  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.9),
    0 18px 40px rgba(190,120,175,.13);

  animation: slideIn .42s ease forwards;
}

.question-box.leave { animation: slideOut .36s ease forwards; }

.bank-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff0f8;
  color: var(--hot);
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 16px;
}

.question-title {
  font-size: 26px;
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 26px;
  font-weight: 900;
}

.options { display: grid; gap: 15px; }

.option {
  border: 0;
  width: 100%;
  padding: 17px 20px;
  border-radius: 22px;
  background: rgba(255,255,255,.92);
  color: #554a68;
  font-size: 17px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(175, 116, 168, .12);
  transition: .22s ease;
}

.option::before {
  content: "♡";
  color: var(--pink);
  margin-right: 10px;
}

.option:hover {
  transform: translateY(-3px) scale(1.01);
  background: linear-gradient(135deg, #fff4fb, #f0fbff);
  box-shadow: 0 16px 34px rgba(175, 116, 168, .2);
}

.loading-screen {
  height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.cat-loader {
  position: relative;
  width: 92px;
  height: 82px;
  border-radius: 38px 38px 32px 32px;
  background: linear-gradient(135deg, #fff, #ffe3f3);
  box-shadow: 0 16px 40px rgba(255, 126, 188, .22);
  animation: pop 1.1s ease-in-out infinite;
}

.ear {
  position: absolute;
  top: -18px;
  width: 36px;
  height: 36px;
  background: #ffe3f3;
  border-radius: 10px;
  transform: rotate(45deg);
}
.ear.left { left: 12px; }
.ear.right { right: 12px; }
.face {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hot);
  font-size: 36px;
  font-weight: 900;
}

.loading-screen h2 { margin: 24px 0 8px; color: var(--ink); }
.loading-screen p { color: var(--muted); font-weight: 700; }

.result {
  padding: 30px 20px;
  text-align: center;
  color: var(--ink);
}

.result .label { font-size: 18px; color: var(--muted); font-weight: 800; }
.result strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--hot);
  font-size: 54px;
  line-height: 1;
}
.result h2 { margin: 8px 0 14px; font-size: 28px; }
.result p { max-width: 650px; margin: 10px auto; line-height: 1.75; color: #655874; font-weight: 700; }
.score-pill {
  display: inline-flex;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff0f8, #eef9ff);
  color: var(--hot);
  font-weight: 900;
}
.result small { color: #9588a3; line-height: 1.7; }

.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.save-btn {
  border: none;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--hot), var(--purple));
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(255, 95, 170, .24);
  transition: .22s ease;
}

.home-btn { background: linear-gradient(135deg, var(--blue), var(--purple)); }
.restart-btn { background: linear-gradient(135deg, #ff9acb, #82d7ff); }

.save-btn:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(255, 95, 170, .32); }
.save-btn:active { transform: translateY(0); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(80px) scale(.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to { opacity: 0; transform: translateX(-90px) scale(.96); }
}
@keyframes pop {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

@media (max-width: 640px) {
  body { overflow-y: auto; align-items: flex-start; }
  .page { padding: 18px; }
  .quiz-card { padding: 24px; min-height: 600px; }
  .quiz-card::before { inset: 8px; }
  h1 { font-size: 32px; }
  .top { align-items: flex-start; flex-direction: column; }
.question-stage {
  position: relative;
  z-index: 1;
  min-height: 500px;
  overflow: visible;
}
  .question-box { padding: 24px; }
  .question-title { font-size: 21px; }
  .option { font-size: 15px; padding: 15px 16px; }
  .result strong { font-size: 42px; }
}
