/* ============================================================
 * 小南娘指数测试 · 杂志感极简样式
 * 暖米底色 + 玫瑰棕主色 + 衬线标题，去 AI 模板感
 * ============================================================ */

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

:root {
  --ink: #3d3338;          /* 主文字 */
  --ink-soft: #6d5f66;     /* 次级文字 */
  --ink-faint: #9a8c92;    /* 弱化文字 */
  --rose: #b06074;         /* 主色：玫瑰棕 */
  --rose-deep: #8f4a5c;    /* 深玫瑰 */
  --rose-pale: #f3e4e8;    /* 浅玫瑰底 */
  --line: #e7dcd7;         /* 描边 */
  --card: #fffdfb;         /* 卡片 */
  --bg: #f6f1ec;           /* 暖米背景 */
  --shadow: 0 1px 2px rgba(80, 50, 60, 0.05), 0 12px 32px rgba(80, 50, 60, 0.1);
}

html,
body {
  height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  background: var(--bg);
  background-image: radial-gradient(
      rgba(176, 96, 116, 0.045) 1px,
      transparent 1px
    );
  background-size: 26px 26px;
  color: var(--ink);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 主舞台 ---------- */

.stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
}

.card {
  width: 100%;
  max-width: 500px;
  min-height: 540px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

/* ---------- 屏幕切换 ---------- */

.screen {
  animation: none;
}

.screen-in {
  animation: screenIn 0.4s ease both;
}

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

.hidden {
  display: none !important;
}

/* ---------- 首页 ---------- */

.kicker {
  text-align: center;
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.kicker::before,
.kicker::after {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 22px;
  height: 1px;
  background: var(--line);
  margin: 0 12px;
}

.title {
  text-align: center;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--ink);
  margin-bottom: 14px;
}

.subtitle {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 2;
  margin-bottom: 34px;
}

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

/* 首页双按钮 */
#screen-home .btn {
  width: 100%;
  max-width: 300px;
}

#screen-home .hint {
  margin-top: 10px;
  margin-bottom: 6px;
}

/* ---------- 按钮 ---------- */

.btn {
  display: block;
  margin: 0 auto;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  padding: 14px 48px;
  border-radius: 10px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
  user-select: none;
}

.btn-primary {
  color: #fff;
  background: var(--rose);
}

.btn-primary:hover {
  background: var(--rose-deep);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  color: var(--rose);
  background: transparent;
  border: 1px solid var(--rose);
  box-sizing: border-box;
}

.btn-ghost:hover {
  background: var(--rose-pale);
}

/* ---------- 答题页 ---------- */

.quiz-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.dim-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--rose);
  white-space: nowrap;
  letter-spacing: 1px;
}

.progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  flex: 1;
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--rose);
  transition: width 0.4s ease;
}

.question {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.8;
  margin-bottom: 26px;
  min-height: 62px;
  color: var(--ink);
}

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

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  user-select: none;
}

.opt-key {
  flex: none;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  transition: all 0.18s ease;
}

.option:hover {
  border-color: var(--rose);
  background: #fffbfa;
}

.option:hover .opt-key {
  border-color: var(--rose);
  color: var(--rose);
}

.option.chosen {
  border-color: var(--rose);
  background: var(--rose-pale);
  color: var(--rose-deep);
  font-weight: 600;
}

.option.chosen .opt-key {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
}

/* 上一题 */
.quiz-foot {
  margin-top: 20px;
  text-align: center;
}

.btn-prev {
  font-family: inherit;
  font-size: 12px;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  letter-spacing: 1px;
  transition: color 0.18s ease;
}

.btn-prev:not(:disabled):hover {
  color: var(--rose);
}

.btn-prev:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ---------- 加载 ---------- */

.loader {
  width: 26px;
  height: 26px;
  margin: 0 auto 22px;
  border: 2px solid var(--line);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loading-text {
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- 结果页 ---------- */

.result-head {
  text-align: center;
  margin-bottom: 24px;
}

.result-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--rose-deep);
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--rose-pale);
}

.ring-wrap {
  position: relative;
  width: 172px;
  height: 172px;
  margin: 0 auto 22px;
}

.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--rose-pale);
  stroke-width: 10;
}

.ring-fg {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 540;
  stroke-dashoffset: 540;
  transition: stroke-dashoffset 0.1s linear;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score {
  font-size: 46px;
  font-weight: 700;
  color: var(--rose);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.score-unit {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 8px;
  letter-spacing: 3px;
}

.tier {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
  margin-bottom: 6px;
}

.tier-tag {
  text-align: center;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--rose);
  margin-bottom: 14px;
}

.tier-desc {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.9;
  padding: 0 6px;
  margin-bottom: 26px;
}

/* 维度条 */

.dims {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
}

.dim {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
}

.dim-head {
  display: contents;
}

.dim-name {
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 1px;
}

.dim-score {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.dim-track {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.dim-fill {
  height: 100%;
  width: 0;
  background: var(--rose);
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-actions {
  display: flex;
  gap: 12px;
}

.result-actions .btn {
  flex: 1;
  margin: 0;
  padding: 13px 12px;
  font-size: 14px;
}

/* ---------- 分享弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(61, 51, 56, 0.5);
  backdrop-filter: blur(3px);
}

.modal-body {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 22px;
  box-shadow: var(--shadow);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 18px;
  color: var(--ink);
}

.share-card-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
}

.share-card-wrap img {
  display: block;
  width: 100%;
}

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

.share-actions .btn {
  flex: 1;
  margin: 0;
  padding: 12px 8px;
  font-size: 13px;
}

/* ---------- 页脚 ---------- */

.footer {
  margin-top: 22px;
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 1px;
  text-align: center;
}

/* ---------- 响应式 ---------- */

@media (max-width: 480px) {
  .card {
    padding: 32px 22px;
    min-height: 480px;
  }

  .title {
    font-size: 26px;
    letter-spacing: 4px;
  }

  .question {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader {
    animation: none;
  }
}
