/* 好友关系鉴定 H5 —— 移动端优先样式 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --primary: #ff5a8a;
  --primary-deep: #e63e70;
  --bg1: #fff0f4;
  --bg2: #ffe9f0;
  --ink: #3a2a33;
  --muted: #9b8791;
  --card: #ffffff;
  --gold: #f5b301;
  --green: #2fb380;
  --shadow: 0 8px 24px rgba(230, 62, 112, .12);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  color: var(--ink);
  min-height: 100vh;
}
#app { max-width: 480px; margin: 0 auto; padding: 16px 16px 40px; }
.hidden { display: none !important; }

.screen { animation: fadein .3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero { text-align: center; padding: 28px 0 18px; }
.hero-emoji { font-size: 52px; }
.hero h1 { font-size: 26px; margin-top: 6px; letter-spacing: 2px; }
.hero .sub { color: var(--muted); font-size: 13px; margin-top: 6px; }

.card {
  background: var(--card); border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.card.center { text-align: center; }
.card-title { font-weight: 700; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: 6px 0 10px; }

/* 答案档案提示条: 告知本次自动带出了几项, 并提供清空入口 */
.profile-tip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 2px 0 12px; padding: 9px 12px;
  border-radius: 10px; background: var(--bg1);
  border: 1px solid rgba(255, 90, 138, .28);
  font-size: 12.5px; color: var(--primary-deep);
}
.profile-tip-text { flex: 1; line-height: 1.5; }
.profile-clear { color: var(--muted); text-decoration: underline; flex-shrink: 0; cursor: pointer; }
.center-text { text-align: center; }

.field-label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
.input {
  width: 100%; border: 1.5px solid #f3d7e0; border-radius: 12px;
  padding: 12px 14px; font-size: 16px; outline: none; background: #fffafb;
}
.input:focus { border-color: var(--primary); }

.btn {
  border: none; border-radius: 14px; padding: 13px 18px; font-size: 16px;
  font-weight: 600; cursor: pointer; transition: transform .1s, opacity .2s;
  font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #ff7aa2); color: #fff; box-shadow: 0 6px 16px rgba(255, 90, 138, .35); }
.btn-ghost { background: #fff0f4; color: var(--primary-deep); }
.btn-block { display: block; width: 100%; margin-top: 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; margin-top: 14px; }
.btn-reward-btn { background: linear-gradient(135deg, #f5b301, #ff9500); color: #fff; box-shadow: 0 6px 16px rgba(245, 179, 1, .35); }
.btn-reward-btn:disabled { opacity: .55; }
.btn-reward-close { background: rgba(255,255,255,.95); color: #333; font-size: 14px; padding: 10px 16px; }

.footer-note { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 22px; line-height: 1.8; }

/* 出题编辑器 */
.q-edit { border-bottom: 1px dashed #f0dbe2; padding: 10px 0; }
.q-edit .q-text { font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.q-edit input { margin-top: 2px; }

/* 分享 */
.share-box {
  background: #fff0f4; border: 1.5px dashed var(--primary); border-radius: 12px;
  padding: 12px; font-size: 12.5px; word-break: break-all; color: var(--primary-deep);
  margin: 12px 0; user-select: all;
}

/* 邀请页 */
.invite-card {
  background: var(--card); border-radius: 22px; padding: 28px 20px;
  box-shadow: var(--shadow); margin-top: 40px; text-align: center;
  animation: pop .4s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.avatar-row { display: flex; justify-content: center; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #ffb36b);
  color: #fff; font-size: 30px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(255, 90, 138, .4);
}
.invite-text { font-size: 17px; line-height: 1.9; margin: 18px 0 8px; }
.invite-text b { color: var(--primary-deep); }
.invite-meta { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.invite-card .input { margin-bottom: 14px; text-align: center; }

/* 答题 */
.progress-wrap { background: #ffd9e3; border-radius: 99px; height: 8px; overflow: hidden; margin-bottom: 14px; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), #ffb36b); border-radius: 99px; transition: width .3s; }
.q-block { padding: 12px 0; border-bottom: 1px dashed #f0dbe2; }
.q-block .q-text { font-weight: 700; font-size: 15.5px; margin-bottom: 10px; }
.q-block .q-tag { display: inline-block; background: var(--primary); color: #fff; font-size: 11px; border-radius: 99px; padding: 2px 10px; margin-right: 6px; vertical-align: 2px; }
.q-block .q-tag.relation { background: #6c7bff; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt {
  border: 1.5px solid #f3d7e0; border-radius: 12px; padding: 11px 8px;
  text-align: center; font-size: 14px; cursor: pointer; background: #fffafb;
  transition: all .15s; word-break: break-all;
}
.opt.selected { border-color: var(--primary); background: #ffeef3; color: var(--primary-deep); font-weight: 700; }
.opt.correct-mark { border-color: var(--green); background: #e9f9f2; color: var(--green); }
.opt.wrong-mark { border-color: #e6533c; background: #fdeeea; color: #e6533c; }

/* 结果页 */
.result-card {
  background: var(--card); border-radius: 22px; padding: 26px 20px;
  box-shadow: var(--shadow); margin-top: 24px; text-align: center;
}
.score-big { font-size: 64px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.score-big small { font-size: 20px; color: var(--muted); font-weight: 400; }
.grade-line { color: var(--muted); font-size: 14.5px; margin: 8px 0; }
.grade-line b { color: var(--primary-deep); font-size: 16px; }

/* 损失厌恶状态行 + 巴纳姆洞察句(优化建议 2 / 5) */
.result-comment {
  text-align: center; font-size: 14px; font-weight: 700;
  color: var(--primary-deep); margin: 12px 0 6px; line-height: 1.6;
}
.result-barnum {
  font-size: 12.5px; color: #9c6b7c; line-height: 1.7;
  background: #fff5f8; border-left: 3px solid #ffb3c9;
  border-radius: 8px; padding: 8px 12px; margin: 8px 0 12px;
}
#result-detail { margin-top: 14px; text-align: left; }
.detail-row { font-size: 13px; padding: 8px 4px; border-bottom: 1px dashed #f0dbe2; line-height: 1.6; }
.detail-row .ok { color: var(--green); font-weight: 700; }
.detail-row .bad { color: #e6533c; font-weight: 700; }

/* 成就图章 */
.stamp {
  width: 168px; height: 168px; margin: 0 auto 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--gold) 65%, #c98a00);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(245, 179, 1, .45), inset 0 0 0 6px rgba(255,255,255,.5);
  animation: stampin .6s cubic-bezier(.2, 1.6, .4, 1);
  position: relative;
}
@keyframes stampin { 0% { transform: scale(2.2) rotate(-25deg); opacity: 0; } 60% { transform: scale(.92) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(-6deg); } }
.stamp-inner { border: 2.5px dashed #8a5d00; border-radius: 50%; width: 140px; height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #6b4a00; transform: rotate(-6deg); }
.stamp-title { font-size: 13px; font-weight: 700; letter-spacing: 2px; }
.stamp-grade { font-size: 24px; font-weight: 800; margin: 6px 0; }
.stamp-note { font-size: 10.5px; letter-spacing: 1px; }

/* 激励视频层（类名刻意避开 ad 字样, 防止被浏览器广告拦截扩展误隐藏） */
.reward-layer {
  position: fixed; inset: 0; background: rgba(0,0,0,.86); z-index: 99;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadein .25s ease;
}
.reward-box { width: 100%; max-width: 380px; }
.reward-tag { text-align: right; color: rgba(255,255,255,.55); font-size: 11px; margin-bottom: 8px; }
.reward-creative {
  background: linear-gradient(150deg, #2b2140, #4a2c6b 55%, #7a3f8f);
  border-radius: 20px; padding: 44px 24px; text-align: center; color: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.reward-logo { font-size: 54px; }
.reward-slogan { font-size: 24px; font-weight: 800; margin: 14px 0 10px; letter-spacing: 2px; }
.reward-desc { font-size: 12.5px; color: rgba(255,255,255,.72); line-height: 1.9; }
.reward-bottom { display: flex; align-items: center; gap: 12px; margin-top: 16px; justify-content: center; }
.reward-count {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.14);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
}
.btn-reward-btn { background: linear-gradient(135deg, #f5b301, #ff9500); color: #fff; box-shadow: 0 6px 16px rgba(245, 179, 1, .35); }
.btn-reward-btn:disabled { opacity: .55; }
.btn-reward-close { background: rgba(255,255,255,.95); color: #333; font-size: 14px; padding: 10px 16px; }

/* 荣誉与统计 */
.honor-card {
  background: linear-gradient(135deg, #2b2140, #6b3f8f);
  border-radius: 18px; padding: 20px; color: #fff; text-align: center;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.honor-icon { font-size: 46px; }
.honor-name { font-size: 20px; font-weight: 800; margin: 6px 0 4px; letter-spacing: 2px; }
.honor-desc { font-size: 12px; color: rgba(255,255,255,.72); line-height: 1.7; }
.honor-next {
  margin-top: 14px; font-size: 14.5px; font-weight: 800;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 217, 122, .14);
  border: 1.5px solid rgba(255, 217, 122, .65);
  box-shadow: 0 0 18px rgba(255, 217, 122, .35);
  animation: honor-glow 1.6s ease-in-out infinite;
}
@keyframes honor-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 217, 122, .25); transform: scale(1); }
  50% { box-shadow: 0 0 26px rgba(255, 217, 122, .6); transform: scale(1.02); }
}
.shine-text {
  background: linear-gradient(90deg, #ffd97a 0%, #ffffff 25%, #ffe9a8 50%, #ffffff 75%, #ffd97a 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 1.6s linear infinite;
  display: inline-block;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.honor-cta {
  display: block; margin-top: 8px; font-size: 12.5px; font-weight: 700;
  color: #ffd97a; animation: cta-bounce 1s ease-in-out infinite;
}
@keyframes cta-bounce { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stat-item { background: var(--card); border-radius: 14px; padding: 12px 4px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-size: 20px; font-weight: 800; color: var(--primary-deep); }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* 排行榜 */
.rank-list { margin-bottom: 14px; }
.rank-row {
  background: var(--card); border-radius: 14px; padding: 13px 14px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.rank-no { width: 30px; font-size: 17px; font-weight: 800; color: var(--muted); text-align: center; }
.rank-no.top1 { color: var(--gold); } .rank-no.top2 { color: #98a6b3; } .rank-no.top3 { color: #c98a5b; }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-weight: 700; font-size: 14.5px; }
.rank-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.rank-score { font-size: 21px; font-weight: 800; color: var(--primary); }
.rank-badge { font-size: 10.5px; background: #fff0f4; color: var(--primary-deep); border-radius: 99px; padding: 2px 8px; margin-left: 6px; }

.quiz-block-item {
  background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.qb-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13.5px; }
.qb-link { color: var(--primary-deep); font-size: 12.5px; cursor: pointer; }
.qb-rows { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 2; }

.toast {
  position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff; border-radius: 99px; padding: 10px 22px;
  font-size: 13.5px; z-index: 100; animation: fadein .2s ease; max-width: 80vw; text-align: center;
}
