/* ============================================================
   古代顶流身份测试 · 新中式 · 宋韵留白
   ============================================================ */

:root {
  --daiqing: #2B3A55;      /* 黛青 深色骨架 */
  --xuanmo: #1C2436;       /* 玄墨 深色二号 */
  --xuanzhi: #F7F2E9;      /* 宣纸白 留白底 */
  --yuebai: rgba(255, 255, 255, 0.88);       /* 月白 卡片底（半透明透纹理） */
  --yunmu: #EFE9DE;        /* 云母 浅灰底 */
  --liujin: #C4A468;       /* 鎏金 点缀金 */
  --yanzhi: #A63A4A;       /* 胭脂 情绪强调 */
  --zhuqing: #6B8E6B;      /* 竹青 正向/已选 */
  --chase: #9C8A6E;        /* 茶褐 锁/未解锁 */
  --text-main: #3A3A3A;    /* 正文主文字 */
  --text-sub: #8A8478;     /* 次要文字 */
  --text-weak: #B9B2A4;    /* 弱文字 */

  --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: #EDE7DB url('assets/paper_texture.png') center/cover no-repeat fixed;
  -webkit-font-smoothing: antialiased;
}

body { overflow-x: hidden; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--xuanzhi);
  position: relative;
  overflow: hidden;
}

/* ---------- 页面切换 ---------- */
.page { display: none; min-height: 100vh; }
.page.active { display: block; animation: pageIn .4s ease-out; }
.page-welcome.active,
.page-test.active,
.page-dimension.active,
.page-analyzing.active { display: flex; }

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

/* ---------- 通用按钮 ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 15px 0;
  border: none;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
  font-family: var(--font-sans);
  letter-spacing: .05em;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--daiqing); color: #fff; }
.btn-gold {
  background: url('assets/svg/btn_paywall.svg') center/100% 100% no-repeat;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-lock { width: 18px; height: 18px; }
.btn-outline { background: transparent; color: var(--daiqing); border: 1px solid var(--daiqing); }
.btn-ghost { background: transparent; color: var(--text-sub); font-size: 14px; }
.btn-link { text-decoration: none; }
.btn-bundle {
  background: transparent;
  color: var(--liujin);
  border: 1px solid var(--liujin);
  margin-top: 12px;
  font-size: 15px;
}
.bundle-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 8px;
}
.icp {
  text-align: center;
  font-size: 12px;
  color: var(--text-weak);
  padding: 20px 0 8px;
}
.icp a { color: var(--text-weak); text-decoration: none; }

/* ---------- 欢迎页 ---------- */
.page-welcome {
  background: url('assets/welcome_bg.png') center/cover no-repeat, linear-gradient(180deg, #2B3A55 0%, #1C2436 100%);
  color: #fff;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 48px 32px;
  position: relative;
  overflow: hidden;
}
.welcome-seal-img {
  width: 64px; height: 64px;
  margin-bottom: 28px;
  transform: rotate(-6deg);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.3));
}
.welcome-title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.5;
  margin-bottom: 16px;
}
.welcome-sub {
  font-size: 14px;
  color: rgba(255,255,255,.7);
  line-height: 1.7;
  margin-bottom: 48px;
}
.welcome-cloud-img {
  position: absolute;
  opacity: .55;
  pointer-events: none;
}
.welcome-cloud-img.tl { top: 44px; left: 10px; width: 118px; }
.welcome-cloud-img.tr { top: 40px; right: 10px; width: 86px; }
.welcome-footnote {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  margin-top: 16px;
}
.welcome-resume {
  margin-top: 24px;
  color: var(--liujin);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- 答题页 ---------- */
.page-test {
  background: rgba(247, 242, 233, 0.55);
  padding: 20px 24px 40px;
  flex-direction: column;
}
.test-top {
  position: sticky;
  top: 0;
  background: var(--xuanzhi);
  padding: 12px 0;
  z-index: 10;
}
.test-dimension {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 8px;
  letter-spacing: .1em;
}
.test-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.test-progress {
  flex: 1;
  height: 3px;
  background: var(--yunmu);
  border-radius: 2px;
  overflow: hidden;
}
.test-progress-fill {
  height: 100%;
  background: var(--yanzhi);
  border-radius: 2px;
  transition: width .3s ease;
}
.test-progress-num {
  font-size: 14px;
  color: var(--text-sub);
  letter-spacing: .05em;
}
.test-question {
  flex: 0 0 auto;
  padding: 18px 0 14px;
}
.test-question-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-main);
  font-weight: 500;
}
.test-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.test-option {
  background: var(--yuebai);
  border: 1px solid var(--yunmu);
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  cursor: pointer;
  transition: all .25s ease;
  position: relative;
}
.test-option:active { transform: scale(.98); }
.test-option.selected {
  border-color: var(--zhuqing);
  background: #F2F6F1;
  color: #3E5B3E;
}
.test-option.dimmed { opacity: .4; }
.test-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 0 4px;
}
.test-nav-btn {
  color: var(--text-sub);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 12px;
}
.test-nav-btn.next { margin-left: auto; }

/* ---------- 维度过渡页 ---------- */
.page-dimension {
  background: rgba(247, 242, 233, 0.55);
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  padding: 14vh 40px 40px;
}
.dim-chapter {
  font-family: var(--font-serif);
  font-size: 64px;
  color: var(--daiqing);
  margin-bottom: 12px;
  line-height: 1;
  animation: dimIn .7s ease-out;
}
.dim-name {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--daiqing);
  letter-spacing: .12em;
  margin-bottom: 16px;
  animation: dimIn .7s ease-out .15s both;
}
.dim-guide {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.7;
  animation: dimIn .7s ease-out .3s both;
}
@keyframes dimIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 分析过渡页 ---------- */
.page-analyzing {
  background: linear-gradient(180deg, #2B3A55 0%, #1C2436 100%);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
  color: #fff;
}
.analyzing-ring {
  width: 80px; height: 80px;
  border: 2px solid var(--liujin);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 2s linear infinite;
  margin-bottom: 32px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.analyzing-text {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: .08em;
  color: rgba(255,255,255,.85);
  transition: opacity .5s ease;
  min-height: 30px;
}

/* ---------- 结果页（基础 + 完整共用容器） ---------- */
.page-result, .page-full {
  background: linear-gradient(180deg, rgba(255,255,255,.72) 0%, rgba(247,242,233,.55) 100%);
  padding: 24px 24px 48px;
}

/* 身份卡 */
.identity-card {
  background: var(--daiqing);
  border-radius: 20px;
  padding: 0;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--liujin);
}
.identity-badge {
  display: block;
  width: 90px;
  height: auto;
  margin: 0 auto 8px;
}
.identity-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}
.identity-card-body {
  padding: 18px 20px 24px;
}
.identity-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.identity-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.identity-head-body { min-width: 0; }
.identity-head-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: .05em;
}
.identity-head-title {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}
.identity-title {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: .15em;
  color: var(--liujin);
  margin-bottom: 6px;
}
.identity-name {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .15em;
}
.identity-seal-img {
  position: absolute;
  bottom: 14px; right: 14px;
  width: 48px; height: 48px;
  opacity: .95;
}

/* 信息卡片 */
.card {
  background: var(--yuebai);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--yunmu);
  position: relative;
}
.card-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--daiqing);
  margin-bottom: 12px;
  letter-spacing: .05em;
}
.intro-text { font-size: 15px; line-height: 1.7; color: var(--text-main); }

/* 标签 */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 6px 14px;
  border: 1px solid var(--daiqing);
  color: var(--daiqing);
  border-radius: 20px;
  font-size: 13px;
  background: var(--yuebai);
}

/* 命中信号 */
.signal-text { font-size: 15px; line-height: 1.7; color: var(--text-main); }
.signal-highlight { color: var(--yanzhi); font-weight: 600; }

/* 维度得分条 */
.score-row { margin-bottom: 14px; }
.score-label {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-sub);
  margin-bottom: 6px;
}
.score-bar { height: 8px; background: var(--yunmu); border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; transition: width .8s ease; }

/* 雷达图 */
.radar-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.radar-wrap canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  height: 72%;
}
.radar-legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.radar-legend-item { font-size: 11px; color: var(--text-sub); display: flex; align-items: center; gap: 4px; }
.radar-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* 金句 */
.quote-block {
  background: var(--daiqing);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  color: #fff;
  margin-bottom: 16px;
  position: relative;
}
.quote-text {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.7;
  letter-spacing: .08em;
  color: #fff;
}
.quote-text .hl { color: var(--liujin); }
.quote-seal {
  position: absolute;
  bottom: 12px; right: 12px;
  width: 36px; height: 36px;
  border: 2px solid var(--yanzhi);
  color: var(--yanzhi);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 11px;
  transform: rotate(-8deg);
}

/* 小传模块 */
.bio-section { margin-bottom: 16px; }
.bio-label {
  display: inline-block;
  font-size: 12px;
  color: var(--liujin);
  letter-spacing: .15em;
  margin-bottom: 8px;
  font-weight: 600;
  padding-left: 30px;
  background: url('assets/scroll_v.png') left center/20px auto no-repeat;
}
.bio-text { font-size: 15px; line-height: 1.8; color: var(--text-main); }
.honor-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 14px; line-height: 1.6; color: var(--text-main);
  margin-bottom: 8px;
}
.honor-item::before { content: '·'; color: var(--liujin); font-weight: 700; }

/* 付费墙：失去与得到 */
.answer-wall {
  margin-top: 8px;
  background: var(--yuebai);
  border: 1px solid var(--yunmu);
  border-radius: 16px;
  padding: 24px 20px;
}

/* 失去（暗调） */
.lose-section {
  background: #F4F0E7;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.lose-title {
  font-size: 13px;
  font-weight: 700;
  color: #8A7B66;
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: .08em;
}
.lose-row {
  margin-bottom: 12px;
  padding-left: 14px;
  border-left: 2px solid #DDD2BF;
}
.lose-row:last-child { margin-bottom: 0; }
.lose-row-title {
  font-size: 14px;
  font-weight: 700;
  color: #6B5D4A;
  margin-bottom: 2px;
}
.lose-row-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.65;
}

/* 得到（金色高亮） */
.win-section {
  background: linear-gradient(135deg, #FBF7EE, #F7EFDC);
  border: 1px solid var(--liujin);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}
.win-title {
  font-size: 13px;
  font-weight: 700;
  color: #A67C2E;
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: .08em;
}
.win-row {
  margin-bottom: 12px;
  padding-left: 14px;
  border-left: 2px solid var(--liujin);
}
.win-row:last-child { margin-bottom: 0; }
.win-row-title {
  font-size: 14px;
  font-weight: 700;
  color: #A67C2E;
  margin-bottom: 2px;
}
.win-row-desc {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.65;
}
.paywall-anchor {
  font-size: 12px;
  color: var(--text-weak);
  margin-top: 10px;
  text-align: center;
}

/* 分享卡弹层 */
.share-mask, .unlock-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20,22,30,.85);
  z-index: 100;
  overflow-y: auto;
  padding: 24px;
}
.share-mask.show, .unlock-mask.show { display: flex; }
.share-wrap, .unlock-wrap { margin: auto; position: relative; }
.mask-close-x {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 0 10px auto;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: #2B3A55;
  font-size: 22px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  user-select: none;
}
.share-wrap {
  max-width: 320px;
  width: 100%;
  text-align: center;
}
.share-img { width: 100%; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.4); }
.share-tip { color: rgba(255,255,255,.8); font-size: 13px; margin: 16px 0; }
.share-close { width: auto; padding: 10px 40px; margin: 0 auto; }
.unlock-wrap {
  background: var(--xuanzhi);
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}
.unlock-title { font-family: var(--font-serif); font-size: 18px; color: var(--daiqing); margin-bottom: 8px; }
.unlock-hint { font-size: 13px; color: var(--text-sub); margin-bottom: 16px; }
.unlock-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--yunmu);
  border-radius: 12px;
  font-size: 15px;
  text-align: center;
  margin-bottom: 16px;
  font-family: var(--font-sans);
}
.unlock-input:focus { outline: none; border-color: var(--daiqing); }
.unlock-err { color: var(--yanzhi); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* 免责声明 */
.disclaimer {
  font-size: 11px;
  color: var(--text-weak);
  line-height: 1.6;
  margin-top: 24px;
  text-align: center;
  padding: 0 12px;
}

/* 分享卡片 Canvas 预览容器 */
.share-canvas-wrap { display: none; }

/* ---------- SVG 素材样式 ---------- */
.dim-icon {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
}
.test-dim-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 5px;
}
.radar-wrap { position: relative; }
.radar-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  height: 72%;
  pointer-events: none;
}
.radar-labels {
  position: absolute;
  inset: 0;
}
.radar-label {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.radar-label img { width: 22px; height: 22px; }
.radar-label span { font-size: 10px; color: #8A8478; white-space: nowrap; }
.quote-mark {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  margin: 0 8px;
  opacity: .8;
}
.analyzing-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
}
.analyzing-ring-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: breathe 2s ease-in-out infinite;
}
.analyzing-ripple {
  animation: ripple 2.4s ease-out infinite;
}
.divider {
  display: block;
  width: 60%;
  margin: 20px auto;
  opacity: .7;
}
.scroll-hint {
  text-align: center;
  margin: -6px 0 10px;
}
.scroll-hint img {
  width: 20px;
  height: 20px;
  opacity: .6;
  animation: bounce 1.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: .8; }
}
@keyframes ripple {
  0% { transform: scale(.6); opacity: 0; }
  30% { opacity: .5; }
  100% { transform: scale(1.3); opacity: 0; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}
.signal-seal {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  opacity: .9;
}
.unlocked-tip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 10px;
}
.unlocked-tip img {
  width: 16px;
  height: 16px;
}
.analyzing-compass {
  animation: spin 12s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}
.paywall-book {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 16px;
  border-radius: 12px;
}
.identity-cloud {
  position: absolute;
  left: 6px;
  bottom: 10px;
  width: 90px;
  opacity: .4;
  pointer-events: none;
}

@media (max-width: 360px) {
  .welcome-title { font-size: 26px; }
  .identity-name { font-size: 30px; }
}
