/* MBTI 人格测试 H5 · 暖橙亮色 / 像素标题 / 渐变按钮 */
:root {
  --bg: #fffdfa;
  --hero: #ffeeda;
  --ink: #4a3b32;
  --text: #453a33;
  --body: #6b5c50;
  --muted: #a3958a;
  --faint: #b3a59a;
  --indigo: #ff8f3c;
  --indigo-deep: #f97316;
  --purple: #f28c3c;
  --line: #ffe6d2;
  --grad-primary: linear-gradient(135deg, #ffb765, #ff7a2f);
  --grad-pill: linear-gradient(135deg, #ffc46b, #ff8a3d);
  --card-shadow: 0 6px 20px rgba(255, 138, 61, .10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; -webkit-tap-highlight-color: transparent; }
input, textarea, select { font: inherit; }
.wrap { width: min(100% - 40px, 560px); margin-inline: auto; }
.muted { color: var(--muted); }

/* 通用按钮 */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; padding: 14px 22px; font-size: 16px; transition: opacity .15s, transform .15s; }
.button:active { transform: scale(.98); }
.button.primary { background: var(--grad-primary); color: #fff; }
.button.ghost { background: #fff; border: 1px solid #ffe3cf; color: #7a6a5e; }
.button.full { width: 100%; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.text-link { display: inline-block; color: var(--faint); font-size: 14px; margin-top: 16px; }
.text-link.center { display: block; text-align: center; }

/* 彩色 MBTI 字母 */
.art-m { color: #4db6ac; } .art-b { color: #5b7fc0; } .art-t { color: #e8a04c; } .art-i { color: #e5c85c; }

/* 首页 · 像素标题卡 */
.home-hero { position: relative; background: var(--hero); padding: 58px 34px 66px; display: flex; justify-content: center; overflow: hidden; }
.pixel-card {
  position: relative; display: block; width: 100%; max-width: 480px;
  background: #fdfdff; border: 3px solid var(--ink);
  box-shadow: 12px 12px 0 var(--indigo);
  padding: 40px 24px 46px; text-align: center;
}
.pixel-card h1 { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 10px; font-size: clamp(30px, 7.6vw, 42px); font-weight: 900; letter-spacing: 2px; line-height: 1.3; }
.outline-text { color: transparent; -webkit-text-stroke: 1.6px var(--ink); }
.gradient-text { background: linear-gradient(120deg, #ff9f4a, #ff6f2c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pixel-card .sub { font-size: clamp(22px, 5.6vw, 30px); font-weight: 900; letter-spacing: 4px; margin-top: 18px; }
.go-arrow {
  position: absolute; right: -22px; bottom: -22px; width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, #ffa94d, var(--indigo-deep)); color: #fff;
  display: grid; place-items: center; font-size: 30px; line-height: 1;
}
.px { position: absolute; width: 6px; height: 6px; background: var(--hero); }
.px-tl { top: -3px; left: -3px; box-shadow: 6px 0 var(--hero), 0 6px var(--hero), 6px 6px var(--ink); }
.px-tr { top: -3px; right: -3px; box-shadow: -6px 0 var(--hero), 0 6px var(--hero), -6px 6px var(--ink); }
.px-bl { bottom: -3px; left: -3px; box-shadow: 6px 0 var(--hero), 0 -6px var(--hero), 6px -6px var(--ink); }
.px-br { bottom: -3px; right: -3px; box-shadow: -6px 0 var(--hero), 0 -6px var(--hero), -6px -6px var(--ink); }
.sparkle { position: absolute; width: 16px; height: 16px; background: var(--indigo); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.sparkle.s1 { top: 24%; left: 3%; }
.sparkle.s2 { top: 34%; left: 11%; width: 9px; height: 9px; background: #ffc48f; }
.sparkle.s3 { top: 24%; right: 7%; width: 18px; height: 18px; }
.sparkle.s4 { top: 32%; right: 12%; width: 8px; height: 8px; background: #ffc48f; }

/* 首页 · 测试卡片列表 */
.section-title { text-align: center; font-size: 22px; font-weight: 700; margin: 34px 0 24px; }
.test-card { display: flex; justify-content: space-between; gap: 14px; background: #fff; border-radius: 18px; padding: 22px; margin-bottom: 18px; box-shadow: var(--card-shadow); }
.test-card-info h3 { font-size: 20px; font-weight: 700; }
.test-card-info p { color: var(--muted); font-size: 13px; margin: 8px 0 20px; }
.pill-button { display: inline-block; background: var(--grad-pill); color: #fff; font-size: 14px; padding: 9px 26px; border-radius: 999px; }
.pill-button:active { opacity: .85; }
.test-card-art {
  position: relative; width: 106px; min-width: 106px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(160deg, #fff4ea, #ffe6cf);
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 2px 6px; padding: 14px 8px 32px;
}
.test-card-art span { font-size: 25px; font-weight: 800; }
.test-card-art small { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(58, 55, 82, .55); color: #fff; font-size: 10px; text-align: center; padding: 5px 0; }
.test-card-art.art-report { background: linear-gradient(160deg, #fff0e9, #ffe0d0); }
/* 首页品牌与 MBTI 介绍 */
.home-brand {
  display: flex; align-items: baseline; justify-content: space-between;
  width: 100%; margin-inline: 0; background: var(--hero);
  padding: 18px max(20px, calc((100% - 560px) / 2)) 16px;
}
.home-brand > span:first-child { font-size: 16px; font-weight: 700; letter-spacing: 2px; color: var(--ink); }
.home-brand-sub { font-size: 11px; letter-spacing: 1px; color: var(--faint); }
.mbti-intro { background: #fff; border-radius: 18px; padding: 24px 22px; margin-top: 8px; box-shadow: var(--card-shadow); }
.mbti-intro h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.mbti-intro > p { color: var(--body); font-size: 14px; line-height: 1.95; }
.dimension-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dimension-chips span { background: #fff3e8; color: #7a6a5e; font-size: 12px; padding: 7px 14px; border-radius: 99px; }
.home-note { text-align: center; color: var(--faint); font-size: 12px; line-height: 2; margin: 26px 0 6px; }
.home-footer { text-align: center; color: #c2b3a6; font-size: 11px; letter-spacing: 1px; padding-bottom: 34px; }

/* 内页头部 */
.simple-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 6px; }
.simple-header h1 { font-size: 17px; font-weight: 600; }
.back-button, .home-button { font-size: 22px; color: #7a6a5e; width: 36px; height: 36px; display: grid; place-items: center; }
.page-main { padding: 14px 0 56px; }

/* 测试须知 */
.guide-intro h1 { font-size: 24px; line-height: 1.5; margin: 12px 0 10px; }
.guide-intro p { color: var(--muted); font-size: 14px; }
.rules-section, .notice-section { background: #fff; border-radius: 16px; padding: 22px; margin-top: 20px; box-shadow: var(--card-shadow); }
.rules-section h2, .notice-section h2 { font-size: 17px; margin-bottom: 14px; }
.rules-list { list-style: none; }
.rules-list li { display: flex; gap: 12px; margin-bottom: 14px; }
.rules-list li:last-child { margin-bottom: 0; }
.rules-list span { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #fff0e2; color: var(--purple); font-size: 13px; display: grid; place-items: center; margin-top: 2px; }
.rules-list p, .notice-section p { font-size: 14px; color: var(--body); line-height: 1.9; }
.participant-form { margin-top: 26px; }
.participant-form label { display: block; font-size: 14px; margin-bottom: 10px; }
.participant-form label span { color: var(--faint); font-size: 12px; margin-left: 6px; }
.participant-form input { width: 100%; background: #fff; border: 1px solid #ffe3cf; border-radius: 12px; padding: 14px; margin-bottom: 20px; outline: none; }
.participant-form input:focus { border-color: var(--purple); }

/* 答题页 */
.test-hero { position: relative; background: linear-gradient(180deg, var(--hero), var(--bg)); padding: 36px 20px 6px; text-align: center; }
.constellation { position: absolute; left: 6px; top: 10px; width: 108px; color: #f0c49b; pointer-events: none; }
.test-hero h1 { font-size: 40px; font-weight: 800; letter-spacing: 2px; }
.test-hero-name { color: #5f4f45; font-size: 34px; margin-left: 12px; letter-spacing: 6px; }
.test-hero p { color: var(--faint); font-size: 13px; margin-top: 8px; }
.test-body { padding-top: 22px; padding-bottom: 56px; }
.test-progress > div:first-child { display: flex; justify-content: space-between; font-size: 13px; color: #9c8d80; }
.progress-track { height: 6px; background: #ffe9d8; border-radius: 99px; overflow: hidden; margin-top: 10px; }
#progress-bar { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffc46b, var(--purple)); border-radius: 99px; transition: width .3s; }
.question-card { margin-top: 30px; }
.question-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 12px; color: var(--faint); }
.dimension-tag { background: #ffeede; color: var(--purple); padding: 3px 12px; border-radius: 99px; }
.question-title { font-size: 21px; font-weight: 700; line-height: 1.65; margin-bottom: 24px; }
.answer-option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  background: #fff; border: 2px solid transparent; border-radius: 14px; padding: 18px;
  margin-bottom: 14px; font-size: 16px; line-height: 1.65; color: #52443c; box-shadow: var(--card-shadow);
}
.choice-letter { color: var(--muted); font-weight: 700; }
.answer-option.selected { border-color: var(--purple); background: #fff4ec; }
.answer-option.selected .choice-letter { color: var(--purple); }
.test-controls { display: flex; gap: 12px; margin-top: 28px; }
.test-controls .button { flex: 1; }
.test-hint { text-align: center; color: var(--faint); font-size: 12px; margin-top: 18px; }
.inline-error { background: #fdeeee; color: #c05b5b; border-radius: 12px; padding: 12px 16px; font-size: 14px; margin-top: 16px; }

/* 历史报告 */
.history-heading h1 { font-size: 24px; line-height: 1.5; margin: 12px 0 10px; }
.history-heading p { color: var(--muted); font-size: 14px; }
.history-list { margin: 24px 0; }
.history-item { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 16px; padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--card-shadow); }
.history-item h2 { font-size: 20px; color: var(--indigo); }
.history-item h2 span { color: var(--text); font-size: 15px; font-weight: 500; margin-left: 10px; }
.history-item p { color: var(--muted); font-size: 12px; margin-top: 6px; }
.history-item > a { color: var(--purple); font-size: 22px; }
.empty-history { text-align: center; padding: 40px 0; }
.empty-history h2 { font-size: 18px; margin-bottom: 10px; }
.empty-history p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

/* 报告页 · 青春紫橙 */
.report-page { background: #f8f7fc; }
.report-shell { padding-bottom: 40px; --violet: #7c5cfc; --coral: #ff8a66; --sky: #4ea8ff; --mint: #3ed598; }
.report-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; padding-bottom: 16px; border-bottom: 2px solid rgba(124, 92, 252, .22); }
.report-topbar .brand { font-weight: 700; font-size: 15px; color: #4b3f6e; }
.copy-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .8); color: #7c5cfc; font-size: 13px; font-weight: 600; padding: 8px 18px; border-radius: 999px; box-shadow: 0 2px 10px rgba(124, 92, 252, .12); }
.copy-pill:active { opacity: .8; }
.report-hero { position: relative; background: linear-gradient(165deg, #fdf3ff, #f3edff 55%, #ece9ff); padding: 22px 24px 56px; text-align: center; overflow: hidden; }
.report-hero::before { content: ''; position: absolute; top: -90px; right: -70px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 138, 102, .30), rgba(255, 138, 102, 0) 68%); pointer-events: none; }
.report-hero-inner { position: relative; }
.hero-stripe { height: 10px; border-radius: 99px; margin-top: 20px; background: linear-gradient(90deg, #7c5cfc, #a58bff 45%, #ffb199 78%, #ff8a66); box-shadow: 0 6px 16px rgba(124, 92, 252, .18); }
.hero-dots { height: 14px; margin-top: 12px; background-image: radial-gradient(circle, #cfc5f2 2.5px, transparent 3px); background-size: 26px 14px; background-position: center; background-repeat: repeat-x; }
.hero-ghost { position: absolute; left: -8px; top: 120px; writing-mode: vertical-rl; font-size: 18px; font-weight: 900; letter-spacing: 10px; color: rgba(124, 92, 252, .16); pointer-events: none; }
.hero-quote { position: absolute; top: -6px; right: 5%; font-size: 120px; line-height: 1; color: rgba(255, 138, 102, .32); font-weight: 900; pointer-events: none; }
.report-date { color: #b0a8cc; font-size: 11px; letter-spacing: 2px; margin-top: 30px; }
.report-kicker { color: #8f86ad; font-size: 14px; margin-top: 16px; }
.report-kicker em { font-style: normal; color: #ff8a66; font-weight: 800; margin-left: 4px; }
.report-type { font-size: clamp(56px, 17vw, 88px); font-weight: 900; letter-spacing: 6px; margin: 2px 0 6px; color: #7c5cfc; text-shadow: 0 14px 30px rgba(124, 92, 252, .22); }
.report-name { font-size: 24px; font-weight: 900; color: #5b3fd6; }
.report-name::after { content: ''; display: block; width: 44px; height: 5px; border-radius: 99px; margin: 12px auto 0; background: linear-gradient(90deg, #ff8a66, #ffb199); }
.report-tagline { color: #8f86ad; font-size: 14px; margin-top: 12px; line-height: 1.9; }
.report-body { max-width: 680px; margin: auto; padding: 0 20px; }
.report-section { background: #fff; border-radius: 20px; padding: 24px; margin-top: 18px; box-shadow: 0 8px 24px rgba(124, 92, 252, .06); }
.report-section-label { color: #c3bcd9; font-size: 11px; letter-spacing: 2px; }
.report-section h2 { font-size: 20px; font-weight: 800; margin: 8px 0 16px; }
.report-section h3 { font-size: 16px; margin: 20px 0 10px; }
.report-section p { color: #565070; font-size: 15px; line-height: 1.95; }
.sec-violet h2 { color: #7c5cfc; }
.sec-orange h2 { color: #ff8a66; }
.sec-blue h2 { color: #4ea8ff; }

/* 四维度 · 居中生长式彩色条 */
.dimension-result { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; gap: 12px; margin-top: 20px; }
.dimension-result:first-child { margin-top: 4px; }
.dim-side { font-size: 12px; color: #6d6588; white-space: nowrap; }
.dim-side.right { text-align: right; }
.dim-bar { position: relative; height: 16px; background: #eceaf3; border-radius: 99px; overflow: hidden; }
.dim-fill { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; border-radius: 99px; color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; transition: width .5s; }
.dim-fill.to-left { right: 50%; }
.dim-fill.to-right { left: 50%; }
.dim-0 .dim-fill.to-left { background: linear-gradient(90deg, #a58bff, #7c5cfc); }
.dim-0 .dim-fill.to-right { background: linear-gradient(90deg, #7c5cfc, #a58bff); }
.dim-1 .dim-fill.to-left { background: linear-gradient(90deg, #8fc9ff, #4ea8ff); }
.dim-1 .dim-fill.to-right { background: linear-gradient(90deg, #4ea8ff, #8fc9ff); }
.dim-2 .dim-fill.to-left { background: linear-gradient(90deg, #ffb199, #ff8a66); }
.dim-2 .dim-fill.to-right { background: linear-gradient(90deg, #ff8a66, #ffb199); }
.dim-3 .dim-fill.to-left { background: linear-gradient(90deg, #7ee8bd, #3ed598); }
.dim-3 .dim-fill.to-right { background: linear-gradient(90deg, #3ed598, #7ee8bd); }
.tie-note { grid-column: 1 / -1; color: #b0a8cc; font-size: 12px; }

/* 字母释义 */
.letter-item { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid #f4f1fb; }
.letter-item:last-child { border-bottom: none; }
.letter-item strong { font-size: 30px; color: #7c5cfc; line-height: 1.2; }
.letter-item h3 { display: inline-block; font-size: 13px; color: #fff; background: linear-gradient(120deg, #ffb199, #ff8a66); border-radius: 4px; padding: 2px 10px; margin: 0 0 8px; }
.letter-item p { font-size: 13px; }

/* 性格特点 · 标题在上、列表在下 */
.trait-columns { display: grid; gap: 16px; grid-template-columns: 1fr; }
.trait-block { display: flex; flex-direction: column; gap: 14px; background: #f7f4ff; border-radius: 14px; padding: 18px; }
.trait-block.challenges { background: #fff4ef; }
.trait-side { display: block; width: 100%; letter-spacing: 6px; font-size: 15px; font-weight: 700; color: #7c5cfc; border-bottom: 1px solid rgba(124, 92, 252, .18); padding-bottom: 10px; }
.trait-block.challenges .trait-side { color: #ff8a66; border-bottom-color: rgba(255, 138, 102, .22); }
.trait-list { list-style: none; }
.trait-list li { color: #565070; font-size: 14px; line-height: 1.9; padding-left: 16px; position: relative; margin-bottom: 14px; }
.trait-list li:last-child { margin-bottom: 0; }
.trait-list li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: #a58bff; }
.trait-block.challenges .trait-list li::before { background: #ffb199; }
.trait-list li b { display: block; font-size: 15px; color: #7c5cfc; line-height: 1.5; }
.trait-block.challenges .trait-list li b { color: #ff8a66; }
.trait-list li p { font-size: 13px; line-height: 1.85; margin-top: 2px; }

/* 成长建议 · 标题+描述 */
.growth-list { display: grid; gap: 12px; }
.growth-item { background: linear-gradient(120deg, #a58bff, #7c5cfc); color: #fff !important; font-size: 14px; border-radius: 12px; padding: 14px 18px; line-height: 1.8 !important; }
.growth-item.alt { background: linear-gradient(120deg, #ffb199, #ff8a66); }
.growth-item b { display: block; font-size: 15px; margin-bottom: 2px; }
.growth-item span { display: block; font-size: 13px; opacity: .92; }

/* 工作环境 · 最佳/最差色块 */
.env-block { border-radius: 14px; overflow: hidden; margin-top: 16px; border: 1px solid #eee7fb; }
.env-block-header { display: flex; align-items: center; justify-content: space-between; color: #fff; font-size: 15px; font-weight: 700; padding: 12px 18px; }
.env-block-header em { font-style: normal; font-size: 20px; letter-spacing: 3px; opacity: .55; font-weight: 900; }
.env-block.best .env-block-header { background: linear-gradient(90deg, #a58bff, #7c5cfc); }
.env-block.worst .env-block-header { background: linear-gradient(90deg, #9aa3b8, #5c6b8a); }
.env-block p { font-size: 14px; line-height: 1.9; padding: 14px 18px; }

/* 职业参考宝典 */
.career-intro { color: #565070; font-size: 14px; line-height: 1.9; }
.career-block { background: #faf9ff; border: 1px solid #efe9ff; border-radius: 14px; padding: 18px; margin-top: 16px; }
.career-block-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; color: #5b3fd6; }
.career-clip { font-size: 18px; }
.career-block-desc { color: #565070; font-size: 14px; line-height: 1.9; margin-top: 10px; }
.career-tags { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.career-tags span { background: #f1edff; color: #7c5cfc; font-size: 13px; padding: 8px 12px; border-radius: 200px; text-align: center; }
.report-disclaimer { background: #f8f6fd; border-radius: 12px; padding: 16px; }
.report-disclaimer p { font-size: 12px; color: #a49bc2; }
.report-bottom-actions { display: flex; gap: 12px; margin-top: 20px; }
.report-bottom-actions .button { flex: 1; font-size: 14px; padding: 13px; }
.report-bottom-actions .button.primary { background: linear-gradient(135deg, #a58bff, #7c5cfc); }
.report-bottom-actions .button.ghost { border-color: #e3dcf5; color: #8f86ad; }
.report-loading { padding-top: 120px; }

/* 空状态 / 加载 / 提示 */
.empty-page { text-align: center; padding-top: 100px; }
.empty-page h1 { font-size: 22px; margin-bottom: 12px; }
.empty-page p { color: var(--muted); margin-bottom: 24px; }
.loading-state { text-align: center; padding: 48px 0; color: var(--muted); font-size: 14px; }
.spinner { display: inline-block; width: 26px; height: 26px; border: 3px solid #ffe9d8; border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 60px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; font-size: 14px; padding: 12px 22px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; max-width: 86vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .home-hero { padding: 72px 34px 76px; }
  .career-tags { grid-template-columns: repeat(3, 1fr); }
}
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  @page { margin: 12mm 10mm; }
  .report-topbar, .report-bottom-actions, .toast { display: none; }
  .report-section { box-shadow: none; break-inside: avoid; }
  .report-section .report-section-label { color: #7c5cfc !important; }
  .report-hero, .env-block, .career-block, .trait-block { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
}
