/* 天赋潜能测试 · H5 样式 */
:root {
  --bg-deep: #0b1030;
  --bg-mid: #161b46;
  --card: rgba(255, 255, 255, 0.055);
  --card-strong: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f6ff;
  --muted: #a8b0d8;
  --muted-2: #7e88b8;
  --gold: #e8c87a;
  --gold-2: #f6dfa6;
  --cyan: #6ee7e7;
  --violet: #9b8cff;
  --danger: #ff9b9b;
  --radius: 18px;
}

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

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 700px at 20% -10%, #2a2a6b 0%, transparent 60%),
              radial-gradient(900px 600px at 110% 20%, #1c3a63 0%, transparent 55%),
              linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 60%, #080c22 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.bg-glow { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .25; pointer-events: none; z-index: 0; }
.bg-glow-a { width: 320px; height: 320px; background: #6f5cff; top: -80px; left: -120px; }
.bg-glow-b { width: 280px; height: 280px; background: #21c7c7; bottom: 10%; right: -140px; }

#app { position: relative; z-index: 1; width: 100%; max-width: 520px; margin: 0 auto; min-height: 100vh; }

.page { display: none; min-height: 100vh; animation: pageIn .45s ease both; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 通用按钮 */
.btn {
  border: 0; outline: 0; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  border-radius: 999px; padding: 14px 26px; transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  color: #241d0d;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 10px 28px rgba(232, 200, 122, .22);
}
.btn-primary:hover { box-shadow: 0 12px 34px rgba(232, 200, 122, .34); }
.btn-ghost { color: var(--text); background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }

/* 授权码弹窗 */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(6, 9, 28, .42); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); }
.modal-overlay.active { display: flex; }
.modal-card { width: 100%; max-width: 350px; max-height: calc(100vh - 36px); overflow-y: auto; text-align: center; padding: 20px 20px 18px; border-radius: 18px; background: linear-gradient(160deg, rgba(46,42,105,.95), rgba(18,22,56,.97)); border: 1px solid rgba(255,255,255,.16); box-shadow: 0 20px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08); animation: modalIn .32s cubic-bezier(.2,.9,.3,1) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
.unlock-badge { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; font-size: 18px; color: var(--gold); background: rgba(232,200,122,.1); border: 1px solid rgba(232,200,122,.28); margin: 0 auto 14px; box-shadow: 0 0 30px rgba(232,200,122,.12); }
.unlock-title { font-size: 20px; margin: 12px 0 6px; letter-spacing: .01em; }
.unlock-desc { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0 0 18px; }
.code-boxes { display: flex; gap: 7px; width: 100%; justify-content: center; }
.code-box { width: 40px; height: 44px; flex: 0 1 40px; text-align: center; font-size: 19px; font-weight: 700; color: var(--text); font-family: inherit; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.06); outline: none; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.code-box:focus { border-color: var(--gold); background: rgba(232,200,122,.1); box-shadow: 0 0 0 3px rgba(232,200,122,.1); }
.code-box.filled { border-color: rgba(110,231,231,.5); }
.code-boxes.error .code-box { border-color: var(--danger); background: rgba(255,155,155,.08); }
.code-boxes.shake { animation: shake .4s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.unlock-error { min-height: 16px; color: var(--danger); font-size: 11px; margin: 8px 0 2px; }
.btn-unlock { width: 100%; font-size: 15px; padding: 12px; margin-top: 2px; }
.unlock-note { color: var(--muted-2); font-size: 10px; margin-top: 10px; }

/* 首页 */
.intro-wrap { padding: 74px 28px 46px; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gold); font-size: 11px; letter-spacing: .28em; font-weight: 600; }
.eyebrow-line { width: 26px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.eyebrow-line:last-child { transform: rotate(180deg); }
.intro-title { margin: 26px 0 16px; font-size: 34px; line-height: 1.32; letter-spacing: -.02em; font-weight: 700; }
.intro-title span { background: linear-gradient(90deg, var(--gold-2), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro-desc { color: var(--muted); font-size: 14px; line-height: 1.85; margin: 0 0 34px; }

.feature-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 36px; }
.feature-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); backdrop-filter: blur(10px); }
.feature-icon { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--gold); background: rgba(232,200,122,.12); font-size: 17px; }
.feature-item strong { display: block; font-size: 14px; margin-bottom: 6px; }
.feature-item span { display: block; color: var(--muted-2); font-size: 11.5px; line-height: 1.65; }
.btn-start { width: 100%; font-size: 16px; padding: 17px; }
.btn-start span { margin-left: 8px; }
.intro-note { text-align: center; color: var(--muted-2); font-size: 11px; margin-top: 18px; }

/* 答题页 */
.quiz-header { display: flex; align-items: center; gap: 14px; padding: 22px 22px 14px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding-bottom: 3px; }
.quiz-progress-text { flex: 1; font-size: 13px; color: var(--muted); }
.quiz-progress-text b { color: var(--gold); font-size: 17px; }
.quiz-progress-count { font-size: 11px; color: var(--muted-2); }
.progress-track { height: 3px; margin: 0 22px; background: rgba(255,255,255,.09); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--cyan)); border-radius: 4px; transition: width .35s ease; }

.quiz-body { padding: 30px 22px 40px; }
.q-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px 22px; min-height: 186px; backdrop-filter: blur(12px); }
.q-index { color: var(--cyan); font-size: 10.5px; letter-spacing: .22em; font-weight: 600; }
.q-text { font-size: 19px; line-height: 1.65; margin: 18px 0 14px; font-weight: 600; }
.q-tip { color: var(--muted-2); font-size: 11.5px; }

.options { display: flex; flex-direction: column; gap: 11px; margin-top: 20px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px 18px; border-radius: 15px; border: 1px solid var(--line);
  background: rgba(255,255,255,.045); color: var(--text); font-family: inherit; font-size: 14px; cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.option:active { transform: scale(.99); }
.option .opt-key { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.08); color: var(--muted); font-size: 12px; font-weight: 700; }
.option.selected { border-color: var(--gold); background: rgba(232,200,122,.12); }
.option.selected .opt-key { background: var(--gold); color: #241d0d; }

.quiz-actions { display: flex; gap: 12px; margin-top: 24px; }
.quiz-actions .btn { flex: 1; padding: 14px 10px; }
.quiz-hint { text-align: center; color: var(--muted-2); font-size: 11px; margin-top: 20px; line-height: 1.7; }

/* 生成中 */
.loading-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.loader { position: relative; width: 96px; height: 96px; display: grid; place-items: center; margin-bottom: 30px; }
.loader-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.09); border-top-color: var(--gold); border-right-color: var(--cyan); animation: spin 1.1s linear infinite; }
.loader-core { color: var(--gold); font-size: 28px; animation: pulse 1.5s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.9); } }
.loading-wrap h2 { font-size: 18px; margin: 0 0 12px; }
.loading-wrap p { color: var(--muted); font-size: 12.5px; margin: 0 0 26px; }
.loading-bar { width: 190px; height: 3px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; }
.loading-bar-fill { height: 100%; width: 40%; background: linear-gradient(90deg, var(--violet), var(--cyan)); border-radius: 4px; animation: slideLoad 1.4s ease-in-out infinite; }
@keyframes slideLoad { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* 报告 */
.report-wrap { padding: 28px 18px 20px; }
.section { margin-bottom: 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; backdrop-filter: blur(12px); }
.section-title { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.section-title::before { content: ''; width: 3px; height: 15px; border-radius: 3px; background: linear-gradient(180deg, var(--gold), var(--cyan)); }
.section-sub { color: var(--muted-2); font-size: 11.5px; line-height: 1.7; margin: 0 0 16px; }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 26px 20px 22px; border-radius: 22px; background: linear-gradient(145deg, rgba(120,105,255,.24), rgba(30,40,90,.55) 55%, rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.15); text-align: center; }
.hero::after { content: ''; position: absolute; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(232,200,122,.18), transparent 70%); right: -70px; top: -90px; pointer-events: none; }
.hero-top { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: .16em; color: var(--muted); }
.hero-top .hero-brand { color: var(--gold); font-weight: 700; }
.hero-lead { font-size: 12.5px; color: var(--muted); margin: 26px 0 6px; }
.hero-career { font-size: 28px; font-weight: 700; letter-spacing: .02em; background: linear-gradient(90deg, var(--gold-2), #fff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ring-wrap { margin: 14px auto 6px; width: 130px; height: 130px; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-num { transform: rotate(90deg); transform-origin: 65px 65px; }
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 12px; }
.tag { padding: 6px 12px; border-radius: 999px; font-size: 11px; background: rgba(232,200,122,.12); border: 1px solid rgba(232,200,122,.3); color: var(--gold-2); }
.tag.cyan { background: rgba(110,231,231,.1); border-color: rgba(110,231,231,.3); color: var(--cyan); }
.tag.muted { background: rgba(255,255,255,.06); border-color: var(--line); color: var(--muted); }

/* 雷达图 */
.radar-wrap { width: 100%; display: grid; place-items: center; margin: 4px 0 2px; }
.radar-wrap svg { width: 100%; max-width: 330px; height: auto; overflow: visible; }
.radar-note { text-align: center; color: var(--muted-2); font-size: 11px; margin-top: 6px; }
.radar-note b { color: var(--gold); font-weight: 600; }

/* 组合特点 */
.combo-text { font-size: 13.5px; line-height: 1.85; color: #e4e8ff; margin: 0 0 16px; }
.label-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
.label-key { flex: 0 0 46px; font-size: 11px; padding-top: 5px; }
.label-key.fit { color: var(--cyan); }
.label-key.unfit { color: var(--danger); }
.label-values { display: flex; flex-wrap: wrap; gap: 7px; }

/* 排行 */
.rank-list { display: flex; flex-direction: column; gap: 11px; }
.rank-row { display: grid; grid-template-columns: 20px 46px 1fr 34px; align-items: center; gap: 10px; }
.rank-no { font-size: 11px; color: var(--muted-2); }
.rank-name { font-size: 12px; color: var(--muted); }
.rank-row.core .rank-name { color: var(--text); font-weight: 700; }
.rank-track { height: 8px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; }
.rank-fill { height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, rgba(110,231,231,.55), var(--cyan)); transition: width 1s cubic-bezier(.22,.9,.3,1); }
.rank-row.core .rank-fill { background: linear-gradient(90deg, rgba(232,200,122,.5), var(--gold)); }
.rank-score { text-align: right; font-size: 12px; font-weight: 700; color: var(--text); }

/* 天赋类型 */
.type-intro { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 12px 0; }
.type-engine { font-size: 13.5px; line-height: 1.9; color: #e4e8ff; padding: 14px 16px; border-left: 2px solid var(--gold); background: rgba(232,200,122,.06); border-radius: 0 12px 12px 0; }
.type-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* 优势卡片 */
.strength-card { padding: 18px 16px; border-radius: 15px; background: rgba(255,255,255,.045); border: 1px solid var(--line); margin-bottom: 12px; }
.strength-card:last-child { margin-bottom: 0; }
.strength-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.strength-title { font-size: 14px; font-weight: 700; }
.strength-badge { flex: 0 0 auto; font-size: 10px; color: var(--gold); padding: 4px 9px; border-radius: 999px; background: rgba(232,200,122,.12); }
.strength-desc { font-size: 12.5px; line-height: 1.85; color: var(--muted); margin: 12px 0; }
.practice { font-size: 11.5px; line-height: 1.7; color: var(--cyan); background: rgba(110,231,231,.07); padding: 10px 12px; border-radius: 10px; }
.practice b { color: var(--cyan); }

/* 职业卡片 */
.career-card { padding: 16px; border-radius: 15px; background: rgba(255,255,255,.045); border: 1px solid var(--line); margin-bottom: 11px; }
.career-card:last-of-type { margin-bottom: 12px; }
.career-head { display: flex; align-items: center; gap: 9px; }
.career-no { color: var(--muted-2); font-size: 11px; }
.career-name { flex: 1; font-size: 14px; font-weight: 700; }
.career-stars { color: var(--gold); font-size: 11px; letter-spacing: 1px; }
.career-match { font-size: 10px; color: var(--gold-2); padding: 3px 8px; border-radius: 999px; background: rgba(232,200,122,.12); }
.career-line { font-size: 11.5px; line-height: 1.75; color: var(--muted); margin-top: 10px; }
.career-line b { color: #dfe4ff; font-weight: 600; }
.disclaimer { font-size: 10.5px; line-height: 1.7; color: var(--muted-2); padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,.035); }

/* 学习团队人际 */
.growth-row { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed rgba(255,255,255,.09); }
.growth-row:last-child { border-bottom: 0; padding-bottom: 0; }
.growth-row:first-child { padding-top: 4px; }
.growth-key { flex: 0 0 72px; font-size: 11.5px; color: var(--gold); }
.growth-val { flex: 1; font-size: 12px; line-height: 1.8; color: var(--muted); }

/* 行动计划 */
.timeline { position: relative; padding-left: 22px; margin-top: 14px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(180deg, var(--gold), var(--cyan), transparent); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -21px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(232,200,122,.12); }
.timeline-item:nth-child(n+3)::before { background: var(--cyan); box-shadow: 0 0 0 4px rgba(110,231,231,.12); }
.timeline-name { font-size: 12.5px; font-weight: 700; color: var(--gold-2); margin-bottom: 7px; }
.timeline-item:nth-child(n+3) .timeline-name { color: var(--cyan); }
.timeline-text { font-size: 12px; line-height: 1.85; color: var(--muted); }

/* 页脚 */
.report-footer { text-align: center; color: var(--muted-2); font-size: 10.5px; line-height: 1.8; padding: 8px 6px 4px; }
.report-warning { text-align: center; color: var(--danger); font-size: 11px; line-height: 1.7; margin-bottom: 12px; }
.report-actions { display: flex; gap: 12px; padding: 6px 18px 36px; }
.report-actions .btn { flex: 1; padding: 14px 10px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px); background: rgba(12,16,45,.94); border: 1px solid var(--line); color: var(--text); font-size: 12px; padding: 12px 20px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 99; max-width: 88%; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 打印 */
@media print {
  body { background: #fff !important; color: #111 !important; }
  .bg-glow, .report-actions, .toast { display: none !important; }
  #app { max-width: none; }
  .page { display: none !important; }
  .page.active { display: block !important; }
  .section, .hero, .strength-card, .career-card { background: #fff !important; border-color: #ddd !important; color: #111 !important; }
  .q-text, .combo-text, .strength-desc, .career-line, .growth-val, .timeline-text, .section-sub, .rank-name, .rank-score, .type-intro, .type-engine { color: #222 !important; }
}

@media (max-width: 360px) {
  .intro-title { font-size: 29px; }
  .q-text { font-size: 17px; }
  .hero-career { font-size: 24px; }
  .section { padding: 16px 14px; }
}
