/* ============================================================
   前台样式（问卷页 + 结果页）
   配色参照小红书 POP MART Molly 旅行人格测试海报：
   蓝绿渐变天空 / 奶黄花朵 / 白色云朵 / 橙色出发按钮
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(180deg, #EAF9F6 0%, #FFF8EC 40%, #FDF3E3 100%);
    min-height: 100vh;
    color: #2E4A63;
    line-height: 1.6;
}

/* ============ 封面区（整屏背景图） ============ */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 悬浮开始按钮（整图按钮，位置由后台「首页设置」调节距底高度） */
.hero-btn {
    position: absolute;
    left: 0; right: 0;
    width: 76%;
    margin: 0 auto;
    z-index: 2;
    display: block;
    transition: transform 0.15s;
}
.hero-btn img {
    display: block;
    width: 100%; height: auto;
    pointer-events: none;
}
.hero-btn:hover { transform: translateY(-2px); }
.hero-btn:active { transform: translateY(1px); }

/* ============ 题目区 ============ */
.questions {
    max-width: 720px;
    margin: 0 auto;
    padding: 34px 16px 48px;
    scroll-margin-top: 8px;
}

/* ============ 答题区（每题一整张背景图） ============ */
.q-screens { position: relative; }
.q-screen {
    display: none;
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    background-size: 100% 100%;
    background-position: top center;
    background-repeat: no-repeat;
    overflow: hidden;
}
.q-screen.active { display: flex; }
/* 背景上的轻遮罩：保证顶部题目区与底部选项区文字可读 */
.q-screen-shade {
    position: absolute; inset: 0; z-index: 0;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.38) 0%,
        rgba(255, 255, 255, 0) 24%,
        rgba(255, 255, 255, 0) 62%,
        rgba(255, 247, 235, 0.32) 100%);
    pointer-events: none;
}
.q-screen-inner {
    position: relative; z-index: 1;
    width: 100%; max-width: 560px;
    margin: 0 auto;
    padding: max(16px, env(safe-area-inset-top)) 18px 30px;
    box-sizing: border-box;
    display: flex; flex-direction: column;
    min-height: 100vh; min-height: 100dvh;
}
.q-progress {
    align-self: center;
    background: rgba(255, 255, 255, 0.80);
    border: 1px solid rgba(255, 210, 90, 0.65);
    color: #2E4A63; font-weight: 800; font-size: 13px;
    padding: 4px 16px; border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.q-body {
    flex: 1 1 auto;
    display: flex; flex-direction: column;
    padding-top: 2vh;
}

/* 题目区：纯文字保留对话框气泡，纯图不加特效 */
.q-dialog {
    background: #ECEEF0;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 0;
    box-shadow: 0 6px 18px rgba(30, 60, 100, 0.18);
}
.q-dialog::before {
    content: '';
    display: block;
    height: 26px;
    background: linear-gradient(180deg, #6E9BD8, #5B8CCB);
}
.q-title {
    font-size: 18px; font-weight: 800; color: #222; line-height: 1.55;
    padding: 14px 18px; margin: 0;
}
.q-image-box img {
    display: block; width: 100%; height: auto;
    border-radius: 0; margin-bottom: 20px;
    box-shadow: none;
}

/* 选项：纯文字保留气泡（A绿/B蓝/C粉/D黄），纯图不加特效 */
.options { display: flex; flex-direction: column; }
.option {
    display: block;
    cursor: pointer;
}
.option input { display: none; }

.opt-text {
    display: block;
    font-size: 15px; font-weight: 700; line-height: 1.5;
    padding: 14px 18px;
    border-radius: 22px;
    border-bottom-left-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.10);
}
.opt-a .opt-text { background: #D9F2B8; color: #4A7A2A; }
.opt-b .opt-text { background: #C9E2FA; color: #2A5A9A; }
.opt-c .opt-text { background: #FBD3D5; color: #A83A44; }
.opt-d .opt-text { background: #FBF0C0; color: #8A6A2A; }

/* 选中态（仅文字气泡） */
.option:has(input:checked) .opt-text {
    outline: 3px solid rgba(255, 126, 46, 0.65);
    outline-offset: 2px;
}

/* 选项图片按钮：纯图无特效 */
.opt-img img {
    display: block; width: 100%; height: auto;
    border-radius: 0;
    box-shadow: none;
}
.option:has(input:checked) .opt-img img {
    outline: none;
}

/* 导航按钮 */
.quiz-nav { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 20px; }
.btn-nav {
    background: rgba(255, 255, 255, 0.82); color: #2E4A63; border: 1.5px solid #D5E3E7;
    padding: 12px 22px; font-size: 14px; font-weight: 700; border-radius: 40px; cursor: pointer;
}
.btn-nav:hover { background: #E3EDF0; }
.btn-next {
    flex: 1 1 auto; max-width: 260px;
    background: linear-gradient(135deg, #FF9A4D, #FF7E2E);
    color: #fff; border: none;
    padding: 13px 24px; font-size: 15px; font-weight: 800;
    border-radius: 40px; cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 126, 46, 0.40);
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-next:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255, 126, 46, 0.5); }
.btn-next:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.form-tip { margin-top: 12px; font-size: 13px; min-height: 18px; text-align: center; color: #c0392b; }

.footer { text-align: center; font-size: 12px; color: #B9C4CB; margin-top: 26px; }
.quiz-footer { display: none; margin-top: 34px; }

/* ============ 结果页 ============ */
.page { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }

/* ---------- 结果页：纯图模式（配图整张展示为长图，文字排在图片下方） ---------- */
.result-page { min-height: 100vh; background: #fff; }
.result-full-img {
    display: block;
    width: 100%;
    height: auto;   /* 不缩放、不裁切，原比例整张展示 */
}
.result-full-info {
    padding: 26px 20px 48px;
    text-align: center;
}
.result-full-name {
    font-size: 34px;
    font-weight: 900;
    color: #2E4A63;
    margin: 6px 0 2px;
}
.result-full-type {
    display: inline-block;
    color: #fff;
    background: #FF7E2E;
    padding: 3px 16px;
    border-radius: 20px;
    font-size: 14px; font-weight: 700;
    margin-bottom: 22px;
}
.result-full-info .btn-again {
    display: inline-block;
    background: linear-gradient(135deg, #FF9A4D, #FF7E2E);
    color: #fff;
    font-size: 15px; font-weight: 800;
    padding: 12px 34px;
    border-radius: 24px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(255, 126, 46, 0.35);
}

.result-card {
    background: #fff;
    border-radius: 20px;
    padding: 30px 22px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(47, 128, 150, 0.16);
    border-top: 6px solid var(--accent);
    margin-top: 12px;
}
.result-brand { font-size: 12px; color: #A6B6BF; letter-spacing: 2px; }
.result-label { font-size: 14px; color: #8899A6; margin-top: 14px; }
.result-name { font-size: 40px; color: var(--accent); margin: 4px 0 2px; font-weight: 900; }
.result-type {
    display: inline-block;
    font-size: 15px; color: #fff; background: var(--accent);
    padding: 3px 16px; border-radius: 20px; font-weight: 700;
}

.result-avatar {
    width: 88px; height: 88px;
    border-radius: 50%;
    margin: 20px auto 6px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 40px; font-weight: 800;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
.result-image {
    display: block;
    max-width: 260px; width: 80%;
    margin: 18px auto 8px;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.keywords { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.chip { background: #F2F6F8; color: #445; font-size: 12px; padding: 4px 12px; border-radius: 14px; }
.result-desc { font-size: 14px; color: #556677; text-align: left; margin: 14px 4px; }
.motto { font-size: 16px; color: var(--accent); font-weight: 700; margin: 12px 0; }

.score-bars { text-align: left; margin: 18px 0; padding-top: 14px; border-top: 1px dashed #E6EEF2; }
.score-title { font-size: 13px; color: #8899A6; margin-bottom: 10px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.bar-name { width: 60px; font-size: 12px; color: #556677; flex: 0 0 auto; }
.bar-track { flex: 1 1 auto; height: 10px; background: #EEF3F5; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width 0.6s; }
.bar-fill.bar-win { box-shadow: 0 0 0 2px rgba(255, 180, 0, 0.7); }
.bar-val { width: 18px; text-align: right; font-size: 12px; color: #445; }

.btn-share {
    background: var(--accent); color: #fff; border: none; width: 100%;
    padding: 12px; font-size: 15px; font-weight: 700; border-radius: 12px; cursor: pointer; margin-top: 6px;
}
#shareText {
    display: none; width: 100%; height: 74px; margin-top: 10px; padding: 8px;
    font-size: 12px; border: 1px solid #E6EEF2; border-radius: 8px; resize: none; color: #556677;
}
.btn-again {
    display: inline-block; margin-top: 14px; color: #8A9AA6; font-size: 13px; text-decoration: underline;
}

/* ============ 移动端适配 ============ */
@media (max-width: 480px) {
    .hero-title { top: 26%; }
    .hero-title h1 { font-size: 30px; }
    .hero-sub { font-size: 13px; }
    .hero-hint { font-size: 12px; }
    .btn-go { font-size: 15px; padding: 12px 24px; }
    .result-name { font-size: 32px; }
}
