/* ============ AI 颜值测评 · 移动端样式 ============ */
:root {
  --bg-0: #190f2b;
  --bg-1: #2b1647;
  --bg-2: #3d1e63;
  --card: rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #f4eefc;
  --text-dim: #b9a8d6;
  --accent-1: #ff6b9d;
  --accent-2: #b45cff;
  --accent-3: #ffd166;
  --ok: #4cd9a0;
  --danger: #ff5d73;
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { height: 100%; }
body {
  min-height: 100%;
  background: linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 55%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }

.screen { padding: 0 20px calc(28px + env(safe-area-inset-bottom, 0px)); animation: fadeUp .45s ease both; }
.screen-center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100svh; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 首页 ---------- */
.hero { padding-top: calc(64px + env(safe-area-inset-top, 0px)); text-align: center; position: relative; }
.sparkle { position: absolute; color: var(--accent-3); opacity: .8; animation: twinkle 2.4s ease-in-out infinite; }
.s1 { top: 34px; left: 44px; font-size: 18px; }
.s2 { top: 92px; right: 46px; font-size: 13px; animation-delay: .8s; }
.s3 { top: 30px; right: 110px; font-size: 11px; animation-delay: 1.5s; }
@keyframes twinkle { 0%,100% { opacity: .25; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }

.logo { font-size: 40px; letter-spacing: 2px; }
.logo span { display: block; font-size: 16px; font-weight: 400; color: var(--text-dim); letter-spacing: 8px; margin-top: 10px; }
.tagline { margin-top: 14px; color: var(--text-dim); font-size: 14px; }

.hero-phone { margin: 34px auto 0; width: 210px; padding: 26px 18px 30px; border-radius: 30px;
  background: linear-gradient(165deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.2); box-shadow: 0 20px 50px rgba(0,0,0,.35);
  position: relative; }
.hero-phone::before { content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.28); }
.ph-score { text-align: center; }
.ph-score-num {
  font-size: 58px; font-weight: 800;
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 14px rgba(255,107,157,.4));
}
.ph-score-label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.ph-line { height: 1px; margin: 18px 0 14px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent); }
.ph-comment { font-size: 13px; text-align: center; color: var(--text); }
.ph-tags { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.ph-tags span { font-size: 11px; color: var(--text-dim); padding: 4px 10px; border-radius: 20px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }

.cta { margin-top: 34px; display: flex; flex-direction: column; gap: 14px; }
.btn {
  display: block; width: 100%; padding: 16px; border: none; border-radius: 48px;
  font-size: 17px; font-weight: 600; letter-spacing: 2px; color: #fff; cursor: pointer;
  transition: transform .15s, opacity .15s; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 10px 26px rgba(255,107,157,.35);
}
.btn-ghost { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); }
.btn:disabled { opacity: .5; pointer-events: none; }

.privacy { margin-top: 26px; text-align: center; color: var(--text-dim); font-size: 12px; line-height: 1.9; }

/* ---------- 顶栏 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 0 6px; }
.topbar .title { font-size: 17px; font-weight: 600; }
.btn-back { background: none; border: none; color: var(--text); font-size: 30px; line-height: 1; padding: 0 6px 0 0; cursor: pointer; }
.btn-restart { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: var(--text);
  font-size: 13px; padding: 7px 14px; border-radius: 20px; cursor: pointer; }

/* ---------- 上传预览 ---------- */
.preview-wrap { margin-top: 18px; }
.preview-wrap img { width: 100%; max-height: 52vh; object-fit: contain; border-radius: var(--radius);
  border: 1px solid var(--card-border); background: rgba(0,0,0,.25); }
.upload-tip { margin-top: 14px; text-align: center; color: var(--text-dim); font-size: 12.5px; }
#screen-upload .cta { margin-top: 22px; }

/* ---------- 分析中 ---------- */
.scanner { width: 128px; height: 128px; border-radius: 24px; position: relative; margin-bottom: 30px;
  background: radial-gradient(circle at 50% 50%, rgba(255,107,157,.18), transparent 70%); }
.scanner::before { content: ''; position: absolute; inset: 0; border-radius: 24px;
  border: 3px solid transparent; border-top-color: var(--accent-1); border-right-color: var(--accent-2);
  animation: spin 1.1s linear infinite; }
.scanner::after { content: '✦'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: var(--accent-1); animation: pulse 1.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.1); opacity: 1; } }
#analyze-title { font-size: 20px; font-weight: 600; }
.steps { margin-top: 26px; list-style: none; width: 250px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 11px 0; color: var(--text-dim); font-size: 14.5px; transition: color .3s; }
.steps li.done { color: var(--text); }
.steps li.active { color: var(--accent-3); font-weight: 500; }
.step-icon { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-dim); flex: none; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; transition: all .3s; }
.steps li.done .step-icon { background: var(--ok); border-color: var(--ok); }
.steps li.done .step-icon::after { content: '✓'; }
.steps li.active .step-icon { border-color: var(--accent-3); border-top-color: transparent; animation: spin 0.9s linear infinite; }

/* ---------- 结果页 ---------- */
.result-hero { text-align: center; position: relative; padding-top: 10px; }
.score-ring { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.score-ring svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 10; }
.ring-fg { fill: none; stroke: url(#none) transparent; stroke-width: 10; stroke-linecap: round;
  stroke: var(--accent-1); stroke-dasharray: 603.2; stroke-dashoffset: 603.2; filter: drop-shadow(0 0 10px rgba(255,107,157,.6)); }
.score-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-num { font-size: 62px; font-weight: 800; background: linear-gradient(120deg, #fff, var(--accent-1));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.grade-badge { position: absolute; top: 12px; right: 28px; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-1)); color: #fff;
  box-shadow: 0 8px 20px rgba(255,209,102,.4); transform: scale(0); transition: transform .5s cubic-bezier(.2, 1.6, .4, 1); }
.grade-badge.show { transform: scale(1); }
.grade-desc { margin-top: 10px; color: var(--text-dim); font-size: 14px; }

.card { margin-top: 18px; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px 16px; }
.card-title { font-size: 15.5px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(var(--accent-1), var(--accent-2)); }
#radar { width: 100%; height: auto; }

/* 分项条 */
.part-row { margin-bottom: 12px; }
.part-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.part-head .pct { color: var(--accent-1); font-weight: 600; }
.part-track { height: 8px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.part-fill { height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-1)); transition: width 1s cubic-bezier(.2,.7,.3,1); }

/* 撞脸 */
.like-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed rgba(255,255,255,.1); }
.like-row:last-child { border-bottom: none; }
.like-rank { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.1); color: var(--accent-3);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.like-info { flex: 1; }
.like-name { font-size: 15px; font-weight: 600; }
.like-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.like-pct { font-size: 14px; color: var(--accent-1); font-weight: 700; }

/* 评语 */
.comment-row { padding: 12px 0; border-bottom: 1px dashed rgba(255,255,255,.1); }
.comment-row:last-child { border-bottom: none; }
.comment-head { font-size: 13px; color: var(--accent-3); margin-bottom: 4px; font-weight: 600; }
.comment-body { font-size: 14px; line-height: 1.75; }
.comment-body b { color: var(--accent-1); font-weight: 600; }

.result-cta { margin-top: 26px; }
.privacy-note { margin-top: 16px; text-align: center; color: var(--text-dim); font-size: 12px; line-height: 1.8; }

/* ---------- 海报弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(10,4,20,.82); }
.modal-body { position: relative; width: min(92vw, 420px); text-align: center; animation: fadeUp .35s ease both; }
#poster-canvas { width: 100%; border-radius: 18px; box-shadow: 0 16px 50px rgba(0,0,0,.5); }
.modal-body .cta { margin-top: 18px; gap: 10px; }
.modal-body .privacy-note { margin-top: 12px; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 99;
  background: rgba(20,10,35,.92); border: 1px solid rgba(255,255,255,.15); color: #fff;
  padding: 11px 22px; border-radius: 24px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  white-space: nowrap; animation: fadeUp .3s ease both; }

@media (min-height: 780px) {
  .hero { padding-top: calc(84px + env(safe-area-inset-top, 0px)); }
}