:root {
  --bg: #0b0b10;
  --bg-2: #101018;
  --card: rgba(255, 255, 255, 0.045);
  --card-line: rgba(255, 255, 255, 0.09);
  --text: #f2f0f7;
  --text-2: #a7a4b8;
  --text-3: #6f6c80;
  --accent: #ff6b7a;
  --accent-2: #ffb36b;
  --violet: #9a7bff;
  --cyan: #55e6c1;
  --radius: 22px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 40% at 15% 0%, rgba(255, 107, 122, 0.18), transparent 60%),
    radial-gradient(50% 45% at 90% 8%, rgba(154, 123, 255, 0.20), transparent 65%),
    radial-gradient(60% 40% at 50% 100%, rgba(85, 230, 193, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* ---------------------------- 顶栏 ---------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 8px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(11, 11, 16, 0.92), rgba(11, 11, 16, 0));
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 15px;
}
.brand-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 107, 122, 0.18), 0 0 16px rgba(255, 107, 122, 0.8);
}
.topbar-tag {
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--card-line);
  border-radius: 999px;
  padding: 5px 10px;
  letter-spacing: 0.4px;
}

/* ---------------------------- 首页 ---------------------------- */
.hero { padding: 26px 0 20px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  margin: 0 0 18px;
}
.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(85, 230, 193, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(85, 230, 193, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(85, 230, 193, 0); }
  100% { box-shadow: 0 0 0 0 rgba(85, 230, 193, 0); }
}
.hero-title {
  font-size: clamp(30px, 8.6vw, 42px);
  line-height: 1.24;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
  font-weight: 800;
}
.grad {
  background: linear-gradient(96deg, #ff8f7a 0%, #ff6b9a 40%, #b78bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.85;
  margin: 0;
}

/* ---------------------------- 上传 ---------------------------- */
.upload-card { margin: 26px 0 18px; }
.drop-zone {
  position: relative;
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02));
  padding: 42px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
  outline: none;
}
.drop-zone:hover, .drop-zone:focus-visible {
  border-color: rgba(255, 107, 122, 0.55);
  background: linear-gradient(160deg, rgba(255,107,122,0.10), rgba(154,123,255,0.06));
}
.drop-zone.is-drag { border-color: var(--accent); transform: scale(1.01); }
.dz-icon {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 16px;
  display: grid; place-items: center;
  color: var(--accent);
  background: rgba(255, 107, 122, 0.12);
}
.dz-icon svg { width: 26px; height: 26px; }
.dz-title { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.dz-hint { margin: 0; font-size: 12px; color: var(--text-3); line-height: 1.7; }
.dz-loading { display: grid; place-items: center; gap: 14px; }
.dz-loading p { margin: 0; font-size: 13px; color: var(--text-2); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.12);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.upload-preview[hidden] { display: none; }
.upload-preview { display: grid; gap: 12px; }
.preview-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #15151d;
  border: 1px solid var(--card-line);
}
.preview-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-line {
  position: absolute; left: 0; right: 0; height: 34%;
  background: linear-gradient(to bottom, transparent, rgba(255, 107, 122, 0.22), transparent);
  animation: scan 2.6s ease-in-out infinite;
}
@keyframes scan {
  0% { top: -34%; }
  100% { top: 100%; }
}

/* ---------------------------- 选项 ---------------------------- */
.option-chips { display: grid; gap: 10px; margin: 4px 0 22px; }
.chips-label { font-size: 12px; color: var(--text-3); letter-spacing: 0.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--card-line);
  background: rgba(255,255,255,0.035);
  color: var(--text-2);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { color: var(--text); border-color: rgba(255,255,255,0.22); }
.chip.is-on {
  color: #1a1014;
  background: linear-gradient(100deg, #ffd0c2, #ffb1c1);
  border-color: transparent;
  font-weight: 600;
}

/* ---------------------------- 按钮 ---------------------------- */
.btn-primary, .btn-secondary, .btn-ghost {
  font-family: inherit;
  cursor: pointer;
  border-radius: 14px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, opacity 0.2s, box-shadow 0.2s;
}
.btn-primary {
  border: none;
  color: #1a1014;
  background: linear-gradient(100deg, #ffb1a0 0%, #ff8ea6 55%, #d3a6ff 100%);
  font-weight: 700;
  padding: 14px 22px;
  box-shadow: 0 10px 30px -12px rgba(255, 107, 122, 0.75);
}
.btn-primary svg, .btn-secondary svg { width: 18px; height: 18px; flex: none; }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { opacity: 0.32; cursor: not-allowed; box-shadow: none; }
.btn-primary svg { width: 18px; height: 18px; }
.btn-lg { width: 100%; padding: 17px 22px; font-size: 15px; border-radius: 16px; }
.btn-secondary {
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  padding: 15px 22px;
}
.btn-ghost {
  border: 1px solid var(--card-line);
  background: transparent;
  color: var(--text-2);
  padding: 10px 16px;
  font-size: 13px;
  justify-self: start;
}
.btn-ghost:hover { color: var(--text); }

/* ---------------------------- 信任行 ---------------------------- */
.trust-row {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0;
  margin: 26px 0 8px;
}
.trust-row li {
  display: grid;
  gap: 4px;
  text-align: center;
  padding: 14px 6px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}
.trust-row b { font-size: 18px; letter-spacing: -0.3px; }
.trust-row span { font-size: 11px; color: var(--text-3); }

/* ---------------------------- 说明 ---------------------------- */
.how { margin: 40px 0 0; }
.section-title {
  font-size: 15px;
  margin: 0 0 16px;
  letter-spacing: 0.5px;
  color: var(--text);
}
.how-grid { display: grid; gap: 10px; }
.how-item {
  border: 1px solid var(--card-line);
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.025);
  position: relative;
}
.how-num {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1px;
  font-weight: 700;
}
.how-item h4 { margin: 6px 0 6px; font-size: 14px; }
.how-item p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.75; }

/* ---------------------------- 评价 ---------------------------- */
.quotes {
  margin: 34px 0 0;
  display: grid;
  gap: 10px;
}
.quote {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-2);
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--card-line);
  background: rgba(255,255,255,0.025);
}
.quote span { display: block; margin-top: 6px; font-size: 11px; color: var(--text-3); }

/* ---------------------------- 加载 ---------------------------- */
.loading-stage {
  min-height: 72vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 26px;
  text-align: center;
  padding: 40px 0;
}
.radar-big {
  position: relative;
  width: 210px; height: 210px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.radar-ring {
  position: absolute;
  border: 1px solid rgba(255, 107, 122, 0.25);
  border-radius: 50%;
}
.r1 { inset: 0; }
.r2 { inset: 26px; border-color: rgba(255, 255, 255, 0.12); }
.r3 { inset: 52px; border-color: rgba(255, 255, 255, 0.08); }
.radar-sweep {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 107, 122, 0.42), transparent 28%);
  animation: sweep 2.4s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 33%, #000 34%);
  mask: radial-gradient(circle, transparent 33%, #000 34%);
}
@keyframes sweep { to { transform: rotate(360deg); } }
.radar-core {
  width: 96px; height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.16);
  z-index: 2;
  background: #1a1a22;
}
.radar-core img { width: 100%; height: 100%; object-fit: cover; }
.loading-title { margin: 0; font-size: 19px; font-weight: 700; }
.loading-steps {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 12px;
  text-align: left;
  width: 100%;
  max-width: 300px;
}
.loading-steps li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-3);
  transition: color 0.4s;
}
.loading-steps li i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.16);
  transition: all 0.4s;
  flex: none;
}
.loading-steps li.is-active { color: var(--text); }
.loading-steps li.is-active i { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.loading-steps li.is-done { color: var(--text-2); }
.loading-steps li.is-done i { background: var(--cyan); }
.loading-tip { font-size: 12px; color: var(--text-3); margin: 0; }

/* ---------------------------- 结果 ---------------------------- */
.view[hidden] { display: none; }
[hidden] { display: none !important; }
.result-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 8px 0 18px;
  animation: rise 0.6s ease both;
}
.result-photo-wrap {
  position: relative;
  width: 108px; height: 136px;
  flex: none;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
}
.result-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.photo-glow {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,11,16,0.7), transparent 55%);
}
.result-head-info { flex: 1; min-width: 0; }
.result-kicker { margin: 0 0 6px; font-size: 11px; color: var(--text-3); letter-spacing: 2px; }
.archetype {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.4px;
  background: linear-gradient(92deg, #fff 20%, #ffc2b8 70%, #d3b3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.3;
}
.archetype-sub { margin: 4px 0 10px; font-size: 12.5px; color: var(--text-2); }
.score-row { display: flex; align-items: flex-end; gap: 10px; }
.score-big { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.score-big small { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 2px; }
.score-label { font-size: 11px; color: var(--text-2); line-height: 1.5; }
.score-label em { font-style: normal; color: var(--accent-2); }

.tag-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
  animation: rise 0.6s 0.05s ease both;
}
.tag-row .tag {
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 107, 122, 0.12);
  border: 1px solid rgba(255, 107, 122, 0.28);
  color: #ffc9c4;
}

.card {
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018));
  padding: 20px;
  margin-bottom: 14px;
  animation: rise 0.6s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-head h3 { margin: 0; font-size: 14.5px; letter-spacing: 0.3px; }
.card-badge {
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--card-line);
  border-radius: 999px;
  padding: 4px 9px;
}
.impression-text {
  margin: 0 0 16px;
  font-size: 14.5px;
  line-height: 2;
  color: #e8e5f2;
}
.three-sec {
  border-top: 1px dashed rgba(255,255,255,0.1);
  padding-top: 14px;
}
.three-label { font-size: 11.5px; color: var(--text-3); }
.three-sec p { margin: 6px 0 0; font-size: 15px; font-weight: 600; color: #fff; letter-spacing: 0.5px; }

/* 雷达图 */
.radar-wrap { display: grid; place-items: center; }
#radarSvg { width: 100%; max-width: 320px; height: auto; }
#radarSvg text { font-family: var(--font); }
.radar-legend { display: grid; gap: 9px; margin-top: 6px; }
.legend-row { display: grid; grid-template-columns: 66px 1fr 30px; align-items: center; gap: 10px; }
.legend-row span { font-size: 12px; color: var(--text-2); }
.legend-bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.legend-bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #ffb1a0, #ff6b9a 60%, #b78bff);
  transform-origin: left;
  animation: grow 1s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes grow { from { transform: scaleX(0); } }
.legend-row b { font-size: 12px; text-align: right; color: var(--text); font-weight: 600; }

/* 细节列表 */
.dim-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.dim-list li { display: grid; gap: 6px; }
.dim-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dim-key { font-size: 13px; font-weight: 600; }
.dim-score { font-size: 13px; color: var(--accent-2); font-weight: 700; }
.dim-bar { height: 4px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; }
.dim-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgba(255,177,160,0.9), rgba(183,139,255,0.9)); animation: grow 1s ease both; transform-origin: left; }
.dim-note { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin: 0; }

/* 人格评价 */
.card-persona blockquote {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-left: 2px solid rgba(255, 107, 122, 0.65);
  background: rgba(255, 107, 122, 0.06);
  border-radius: 0 12px 12px 0;
  font-size: 14px;
  line-height: 1.9;
  color: #ffe9e4;
}
.strength-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.strength-list li {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  padding-left: 18px;
  position: relative;
}
.strength-list li::before {
  content: "✦";
  position: absolute; left: 0;
  color: var(--accent-2);
  font-size: 11px;
}

/* 妆容 */
.card-makeup { background: linear-gradient(160deg, rgba(255,177,160,0.10), rgba(154,123,255,0.07)); }
.step-list { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.step-list li {
  counter-increment: s;
  position: relative;
  padding-left: 34px;
  font-size: 13.5px;
  line-height: 1.8;
  color: #eae6f3;
}
.step-list li::before {
  content: counter(s);
  position: absolute; left: 0; top: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  color: #ffd9d2;
}
.avoid {
  margin: 0;
  font-size: 12.5px;
  color: #ffb3a8;
  padding-top: 12px;
  border-top: 1px dashed rgba(255,255,255,0.12);
}
.avoid::before { content: "避开 · "; opacity: 0.7; }

/* 穿搭 */
.palette { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.swatch { display: grid; gap: 6px; justify-items: center; font-size: 11px; color: var(--text-2); }
.swatch i {
  width: 48px; height: 48px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  display: block;
}
.item-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 9px; }
.item-list li {
  font-size: 13.5px;
  color: #eae6f3;
  line-height: 1.7;
  padding-left: 16px;
  position: relative;
}
.item-list li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--violet);
}
.hair-tip {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
}
.hair-icon { color: var(--violet); }
.hair-tip p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text-2); }

/* 场景 */
.scene-grid { display: grid; gap: 10px; }
.scene-item {
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.scene-item h5 { margin: 0 0 5px; font-size: 12px; color: var(--accent-2); font-weight: 600; letter-spacing: 0.5px; }
.scene-item p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--text-2); }

/* 只改一件事 */
.card-onething {
  background: linear-gradient(150deg, rgba(255, 107, 122, 0.16), rgba(154, 123, 255, 0.12));
  border-color: rgba(255, 160, 170, 0.3);
}
.onething-label { font-size: 11px; letter-spacing: 2px; color: #ffc4bd; }
.card-onething p { margin: 10px 0 0; font-size: 17px; line-height: 1.7; font-weight: 700; letter-spacing: 0.2px; }

/* 结果操作 */
.result-actions { display: grid; gap: 10px; margin: 22px 0 14px; }
.result-foot { text-align: center; font-size: 11px; color: var(--text-3); line-height: 1.7; margin: 0; }

/* ---------------------------- 分享面板 ---------------------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5, 5, 8, 0.72);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.25s ease both;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%;
  max-width: 560px;
  background: #14141c;
  border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,0.1);
  max-height: 92vh;
  overflow-y: auto;
  animation: up 0.35s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes up { from { transform: translateY(40px); opacity: 0.4; } }
.sheet-grab { width: 38px; height: 4px; border-radius: 99px; background: rgba(255,255,255,0.18); margin: 4px auto 14px; }
.sheet-title { margin: 0 0 14px; font-size: 16px; text-align: center; }
.share-card-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 14px;
  background: #0e0e14;
}
#shareCanvas { width: 100%; height: auto; display: block; }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-btns .btn-primary, .share-btns .btn-secondary { padding: 14px; }
.share-hint { text-align: center; font-size: 11.5px; color: var(--text-3); margin: 12px 0 8px; line-height: 1.6; }
.sheet-close {
  display: block; width: 100%; padding: 12px;
  background: none; border: none; color: var(--text-3);
  font-size: 13px; font-family: inherit; cursor: pointer;
}

/* ---------------------------- Toast ---------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: rgba(28, 28, 38, 0.96);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 90;
  max-width: 86vw;
  text-align: center;
  animation: toastIn 0.25s ease both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

.pc { display: none; }
@media (min-width: 760px) {
  .pc { display: inline; }
  .app { max-width: 640px; padding-bottom: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
