/* ============================================================
   你是哪只狗 · 样式
   主题：奶油黄 + 棕色文字 + 小狗元素
   ============================================================ */

:root {
  --bg: #FFFDF6;
  --card: #FFFFFF;
  --ink: #3B2E1E;
  --ink-soft: #6E5C45;
  --muted: #A8967A;

  --yellow: #FFC93C;
  --yellow-bright: #FFD95A;
  --yellow-deep: #E9A100;
  --yellow-soft: #FFF1C6;
  --yellow-line: #F3E4BE;

  --brown: #8B5E34;
  --brown-soft: #F5E8D5;

  --radius: 22px;
  --shadow-sm: 0 1px 3px rgba(120, 90, 30, .06);
  --shadow: 0 3px 8px rgba(120, 90, 30, .07), 0 14px 36px rgba(120, 90, 30, .09);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: var(--bg);

  /* 奶油底 + 淡淡的爪印纹理 */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='%23F6E7BE' fill-opacity='0.55'%3E%3Cellipse cx='22' cy='26' rx='5.4' ry='7' transform='rotate(-14 22 26)'/%3E%3Cellipse cx='35' cy='19' rx='5.4' ry='7' transform='rotate(-4 35 19)'/%3E%3Cellipse cx='49' cy='19' rx='5.4' ry='7' transform='rotate(4 49 19)'/%3E%3Cellipse cx='62' cy='26' rx='5.4' ry='7' transform='rotate(14 62 26)'/%3E%3Cpath d='M42 34c8.6 0 16 6.9 16 14.4 0 6.4-4.9 10.2-9.7 8.1-2.3-.9-4.1-1.6-6.3-1.6s-4 .7-6.3 1.6c-4.8 2.1-9.7-1.7-9.7-8.1C26 40.9 33.4 34 42 34z'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at 50% -8%, #FFF8DE 0%, transparent 58%),
    radial-gradient(circle at 12% 100%, #FFF4D4 0%, transparent 45%);
  background-attachment: fixed;
  line-height: 1.75;
  min-height: 100vh;
  padding: 48px 20px 80px;
}

.wrap { max-width: 680px; margin: 0 auto; }

h1, h2, h3, .q-text, .result-name, .cover-title {
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}

/* ---------- 通用 ---------- */
.screen { display: none; }
.screen.active { display: block; animation: rise .5s cubic-bezier(.2, .7, .3, 1) both; }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--brown);
  background: var(--yellow-soft);
  border-radius: 999px;
  padding: 6px 15px;
  margin-bottom: 22px;
}

.btn {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 15px 42px;
  font-size: 16px;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:active { transform: translateY(2px) scale(.99); }

.btn-primary {
  background: linear-gradient(180deg, var(--yellow-bright), var(--yellow));
  color: #4A3A1C;
  box-shadow: 0 5px 0 #EDB524, 0 10px 22px rgba(233, 161, 0, .28);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #FFE07A, var(--yellow-bright));
  box-shadow: 0 7px 0 #EDB524, 0 14px 28px rgba(233, 161, 0, .34);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
}
.btn-ghost:hover { color: var(--brown); }

/* ---------- 封面 ---------- */
.cover-inner { text-align: center; padding: 34px 0 0; }

.cover-title { font-size: clamp(34px, 8vw, 54px); }
.cover-title em {
  font-style: normal;
  color: var(--brown);
  position: relative;
  z-index: 0;
}
.cover-title em::after {
  content: "";
  position: absolute;
  left: -3%; right: -3%; bottom: 4%;
  height: 42%;
  background: var(--yellow);
  border-radius: 8px;
  z-index: -1;
  transform: rotate(-1.2deg);
}

.cover-sub {
  margin: 28px auto 0;
  max-width: 460px;
  color: var(--ink-soft);
  font-size: 15.5px;
}

/* 爪印一排：错落轻轻跳 */
.paw-row {
  margin: 32px 0 28px;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 21px;
}
.paw-row span {
  display: inline-block;
  opacity: .55;
  animation: pawBob 2.6s ease-in-out infinite;
}
.paw-row span:nth-child(2) { animation-delay: .18s; }
.paw-row span:nth-child(3) { animation-delay: .36s; }
.paw-row span:nth-child(4) { animation-delay: .54s; }

@keyframes pawBob {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50%      { transform: translateY(-7px) rotate(8deg); }
}

.cover-meta {
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .04em;
}

/* ---------- 进度条 ---------- */
.progress-track {
  position: relative;
  height: 8px;
  background: var(--yellow-line);
  border-radius: 999px;
  margin-bottom: 46px;
}
.progress-fill {
  position: relative;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--yellow-bright), var(--yellow-deep));
  border-radius: 999px;
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}
/* 进度条末端的小爪印 */
.progress-fill::after {
  content: "🐾";
  position: absolute;
  right: -9px;
  top: 50%;
  transform: translateY(-52%);
  font-size: 15px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(120, 90, 30, .25));
}

/* ---------- 答题 ---------- */
.quiz-inner { padding: 0 2px; }

.q-index {
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--brown);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.q-text {
  font-size: clamp(21px, 4.4vw, 27px);
  margin-bottom: 30px;
  min-height: 2.6em;
}

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

.option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--yellow-line);
  border-radius: 16px;
  padding: 17px 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s, background .16s, transform .16s, box-shadow .16s;
}
.option:hover {
  border-color: var(--yellow);
  background: #FFFCF0;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(180, 140, 40, .12);
}
.option.selected {
  border-color: var(--yellow-deep);
  background: var(--yellow-soft);
}

.option-key {
  flex: none;
  width: 25px;
  height: 25px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--yellow-soft);
  color: var(--brown);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: background .16s, color .16s;
}
.option:hover .option-key,
.option.selected .option-key {
  background: var(--yellow);
  color: #4A3A1C;
}

#backBtn { margin-top: 26px; margin-left: -20px; }
#backBtn[hidden] { display: none; }

/* ---------- 结果 ---------- */
.result-inner { text-align: center; }

/* 大圆是结果本人，小圆是对应的 CP */
.duo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  margin: 0 auto 28px;
}
.duo-item { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.duo-ring {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  background: var(--yellow-soft);
  display: grid;
  place-items: center;
}
.duo-ring img { width: 100%; height: 100%; object-fit: cover; display: block; }
.duo-ring img[hidden] { display: none; }

.duo-item--main .duo-ring {
  width: 190px;
  height: 190px;
  border: 7px solid var(--yellow);
  box-shadow: 0 0 0 8px #FFFFFF, var(--shadow);
}
.duo-item--side .duo-ring {
  width: 92px;
  height: 92px;
  border: 5px solid #FFFFFF;
  box-shadow: 0 0 0 3px var(--yellow-line), 0 4px 14px rgba(120, 90, 30, .12);
}

.duo-label {
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted);
}
.duo-item--main .duo-label { color: var(--brown); font-weight: 700; }
.duo-label[hidden] { display: none; }

.dog-emoji { font-size: 80px; line-height: 1; }
.dog-emoji[hidden] { display: none; }

/* 图片加载中的转圈动画 */
.frame-loader {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--yellow-soft);
  display: grid;
  place-items: center;
}
.frame-loader[hidden] { display: none; }

.frame-loader::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--yellow-deep);
  border-right-color: var(--yellow-deep);
  animation: loaderSpin .9s linear infinite;
}
.frame-loader span {
  font-size: 36px;
  line-height: 1;
  animation: loaderPaw 1.2s ease-in-out infinite;
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}
@keyframes loaderPaw {
  0%, 100% { transform: scale(1);    opacity: .7; }
  50%      { transform: scale(1.14); opacity: 1; }
}

/* 主标题是狗的品种，人格名做小字副标题 */
.result-name {
  font-size: clamp(36px, 8vw, 48px);
  margin-bottom: 10px;
}
.result-sub {
  display: inline-block;
  font-size: 14px;
  letter-spacing: .14em;
  color: #7A5410;
  background: var(--yellow-soft);
  border-radius: 999px;
  padding: 5px 16px;
  margin-bottom: 16px;
}

/* 对应楼里的真实用户 */
.result-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--brown);
  background: var(--brown-soft);
  border-radius: 999px;
  padding: 5px 14px;
  margin: 0 auto 18px;
}
.result-user[hidden] { display: none; }
.result-user::before { content: "楼里的"; opacity: .7; }

.result-tagline {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 460px;
  margin: 18px auto 34px;
}

.match-row {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto 40px;
  font-size: 13px;
  color: var(--muted);
}
.match-label { flex: none; letter-spacing: .1em; }
.match-bar {
  flex: 1;
  height: 9px;
  background: var(--yellow-line);
  border-radius: 999px;
  overflow: hidden;
}
.match-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow-bright), var(--yellow-deep));
  transition: width .9s cubic-bezier(.2, .8, .3, 1) .2s;
}
.match-num { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brown); }

.analysis {
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--yellow-line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.analysis h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--brown);
  margin-bottom: 14px;
  font-family: inherit;
  font-weight: 700;
}
/* 标题前的小爪印色块 */
.analysis h3::before {
  content: "";
  width: 15px;
  height: 15px;
  flex: none;
  background: var(--yellow);
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
}
.analysis p { font-size: 15.5px; color: var(--ink-soft); }

/* 语录 */
.quotes { display: flex; flex-direction: column; gap: 14px; }
.quote {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.quote::before {
  content: "";
  position: absolute;
  left: 0;
  top: .35em;
  bottom: .35em;
  width: 4px;
  border-radius: 2px;
  background: var(--yellow);
}

/* 维度条 */
.dims { display: flex; flex-direction: column; gap: 18px; }
.dim { display: flex; align-items: center; gap: 14px; font-size: 13.5px; }
.dim-name { flex: none; width: 3.2em; color: var(--ink-soft); letter-spacing: .04em; text-align: left; }
.dim-track {
  flex: 1;
  height: 9px;
  background: var(--yellow-line);
  border-radius: 999px;
  overflow: hidden;
}
.dim-fill {
  display: block;              /* 关键：span 默认 inline，宽高不生效 */
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow-bright), var(--yellow-deep));
  transition: width .8s cubic-bezier(.2, .8, .3, 1);
}
.dim-val {
  flex: none;
  width: 2.6em;
  text-align: right;
  color: var(--brown);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.runner-up {
  text-align: left;
  padding: 22px 26px;
  margin-bottom: 18px;
  border-left: 4px solid var(--yellow);
  background: linear-gradient(90deg, var(--yellow-soft), transparent);
  border-radius: 0 16px 16px 0;
}
.runner-up[hidden] { display: none; }
.runner-up h3 {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--brown);
  margin-bottom: 6px;
  font-family: inherit;
  font-weight: 700;
}
.runner-up p { font-size: 14.5px; color: var(--ink-soft); }

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 40px 0 0;
}

/* 音乐开关 */
.btn-music {
  font-size: 13px;
  padding: 10px 18px;
  border: 1.5px solid var(--yellow-line);
  background: var(--card);
  border-radius: 999px;
}
.btn-music[hidden] { display: none; }
.btn-music[aria-pressed="true"] {
  color: var(--brown);
  border-color: var(--yellow);
  background: var(--yellow-soft);
}

/* 骨头分割线 */
.bone-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 44px 0 18px;
}
.bone-divider::before,
.bone-divider::after {
  content: "";
  flex: 1;
  height: 1.5px;
  background: var(--yellow-line);
  border-radius: 2px;
}
.bone-divider span { font-size: 15px; opacity: .85; }

.disclaimer {
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
  text-align: left;
}

/* ---------- 小屏 ---------- */
@media (max-width: 480px) {
  body { padding: 30px 16px 60px; }
  .dog-frame { width: 180px; height: 180px; border-width: 6px; }
  .analysis { padding: 22px 20px; }
  .btn { padding: 14px 32px; }
  .dim-name { width: 3em; font-size: 12.5px; }
  .result-sub { font-size: 13px; letter-spacing: .1em; }
}

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


/* ============================================================
   CP 测试专属
   ============================================================ */

/* 答题分段提示 */
.q-block {
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--brown);
  background: var(--yellow-soft);
  display: inline-block;
  border-radius: 999px;
  padding: 4px 13px;
  margin-bottom: 10px;
}
