* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #fff;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.page.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

/* ===== 首页 ===== */
.cover-page {
    background: #fff;
    align-items: center;
    justify-content: center;
    background-image: url('../static/0416-MBTI线上测试画面-11.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 0;
}

.corner-badge {
    width: 88%;
    max-width: 520px;
    margin-top: auto;
    flex-shrink: 0;
}

.corner-badge img {
    width: 100%;
    display: block;
}

.cover-content {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: flex-start;
    padding: 0 4vw 4vh;
}

.logo {
    width: 92%;
    margin-bottom: 1.5vh;
    flex-shrink: 0;
}

.logo img {
    width: 100%;
    display: block;
}

.main-title {
    width: 95%;
    margin-bottom: 1.5vh;
    flex-shrink: 0;
}

.main-title img {
    width: 100%;
    display: block;
}

.relics-collage {
    width: 92%;
    max-height: 38vh;
    flex-shrink: 0;
}

.relics-collage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    animation: sway 2s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes sway {
    0% { transform: rotate3d(0, 0, 1, 0deg); }
    10% { transform: rotate3d(0, 0, 1, 12deg); }
    25% { transform: rotate3d(0, 0, 1, -8deg); }
    40% { transform: rotate3d(0, 0, 1, 4deg); }
    55% { transform: rotate3d(0, 0, 1, -3deg); }
    70% { transform: rotate3d(0, 0, 1, 0deg); }
    100% { transform: rotate3d(0, 0, 1, 0deg); }
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bounceUpDown 1.5s ease-in-out infinite;
}

.scroll-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.scroll-indicator {
    width: 24px;
    height: 40px;
    border: 2px solid #7ED321;
    border-radius: 12px;
    position: relative;
}

.scroll-dot {
    width: 6px;
    height: 6px;
    background: #7ED321;
    border-radius: 50%;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollDot 1.5s ease-in-out infinite;
}

@keyframes bounceUpDown {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes scrollDot {
    0% { top: 6px; opacity: 1; }
    100% { top: 24px; opacity: 0; }
}

/* ===== 文本动画 ===== */
@keyframes textflash {
    0%, 100%, 50% { opacity: 1; }
    25%, 75% { opacity: 0; }
}
.textflash { animation-name: textflash; }

@keyframes textshake {
    0% { opacity: 0; transform: translateX(0); }
    10% { opacity: 1; transform: translateX(-10px); }
    30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
    100% { transform: none; }
}
.textshake { animation-name: textshake; }

@keyframes textbounce {
    0% { opacity: 0; transform: translateY(0); }
    10% { opacity: 1; }
    20%, 50%, 80% { transform: translateY(0); }
    40% { transform: translateY(-30px); }
    60% { transform: translateY(-15px); }
    100% { transform: none; }
}
.textbounce { animation-name: textbounce; }

@keyframes texttada {
    0% { transform: scale(1); opacity: 0; }
    10%, 20% { transform: scale(.9) rotate(-3deg); opacity: 1; }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: none; }
}
.texttada { animation-name: texttada; }

@keyframes textpulse {
    0% { transform: scale(1); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: scale(1.1); }
    100% { transform: none; }
}
.textpulse { animation-name: textpulse; }

@keyframes textswing {
    0% { opacity: 0; }
    10% { opacity: 1; }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(5deg); }
    80% { transform: rotate(-5deg); }
    100% { transform: none; }
}
.textswing { transform-origin: top center; animation-name: textswing; }

@keyframes textwobble {
    0% { transform: translateX(0); opacity: 0; }
    15% { transform: translateX(-25%) rotate(-5deg); opacity: 1; }
    30% { transform: translateX(20%) rotate(3deg); }
    45% { transform: translateX(-15%) rotate(-3deg); }
    60% { transform: translateX(10%) rotate(2deg); }
    75% { transform: translateX(-5%) rotate(-1deg); }
    100% { transform: none; }
}
.textwobble { animation-name: textwobble; }

@keyframes textfloat {
    0% { transform: scale(1) rotateZ(0); opacity: 1; }
    26% { transform: scale(1.1) rotateZ(12deg); opacity: .2; }
    76% { transform: scale(.7) rotateZ(-8deg); opacity: .6; }
    100% { transform: none; opacity: 1; }
}
.textfloat { animation-name: textfloat; }

/* ===== 平移动画 ===== */
@keyframes translationLeft {
    0% { transform: translateX(0); }
    30% { transform: translateX(100%); }
    100% { transform: none; }
}
.translationLeft { animation-name: translationLeft; animation-timing-function: ease-in; }

@keyframes translationRight {
    0% { transform: translateX(0); }
    30% { transform: translateX(-100%); }
    100% { transform: none; }
}
.translationRight { animation-name: translationRight; }

@keyframes translationUp {
    0% { transform: translateY(0); }
    30% { transform: translateY(-100%); }
    100% { transform: none; }
}
.translationUp { animation-name: translationUp; }

@keyframes translationDown {
    0% { transform: translateY(0); }
    30% { transform: translateY(100%); }
    100% { transform: none; }
}
.translationDown { animation-name: translationDown; }

/* ===== 页面切换动画 ===== */
@keyframes slideNextPage {
    0% { transform: translateY(-10px); opacity: 1; }
    100% { transform: translateY(-30px); opacity: 0; }
}

@keyframes slidePrevPage {
    0% { transform: translateY(10px); opacity: 1; }
    100% { transform: translateY(30px); opacity: 0; }
}

/* ===== 浮动热点动画 ===== */
@keyframes floatHotSlideUp {
    0% { transform: translate(-50%, 111px); opacity: 0; }
    70% { transform: translate(-50%, 111px); opacity: 0; }
    100% { transform: translate(-50%, 0); opacity: 1; }
}
.floatHotSlideUp { animation: floatHotSlideUp 1.5s ease forwards; }

@keyframes floatHotFadeIn {
    0% { opacity: 0; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}
.floatHotFadeIn { animation: floatHotFadeIn 1.5s ease forwards; }

/* ===== 渐显动画 ===== */
@keyframes fadeInNormal {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
.fadeInNormal { animation: fadeInNormal 0.6s ease forwards; }

/* ===== 背景渐变动画 ===== */
@keyframes gradientBG {
    0% { background-position: 0; }
    100% { background-position: 300%; }
}

/* ===== 入场动画 ===== */
@keyframes fadeInDown {
    0% { opacity: 0; transform: translate3d(0, -100px, 0); }
    100% { opacity: 1; transform: none; }
}
.fadeInDown { animation: fadeInDown 0.8s ease forwards; }

@keyframes fadeInUp {
    0% { opacity: 0; transform: translate3d(0, 60px, 0); }
    100% { opacity: 1; transform: none; }
}
.fadeInUp { animation: fadeInUp 0.8s ease forwards; }

@keyframes slideDown {
    0% { opacity: 0; transform: translate3d(0, -100%, 0); }
    60% { opacity: 1; transform: translate3d(0, 15px, 0); }
    75% { opacity: 1; transform: translate3d(0, -8px, 0); }
    90% { opacity: 1; transform: translate3d(0, 4px, 0); }
    100% { opacity: 1; transform: none; }
}
.slideDown { animation: slideDown 0.8s ease forwards; }

@keyframes slideUp {
    0% { opacity: 0; transform: translate3d(0, 80px, 0); }
    60% { opacity: 1; transform: translate3d(0, -12px, 0); }
    75% { opacity: 1; transform: translate3d(0, 6px, 0); }
    90% { opacity: 1; transform: translate3d(0, -3px, 0); }
    100% { opacity: 1; transform: none; }
}
.slideUp { animation: slideUp 0.8s ease forwards; }

@keyframes zoomIn {
    0% { opacity: 0; transform: scale3d(0.5, 0.5, 0.5); }
    50% { opacity: 1; }
    100% { transform: none; }
}
.zoomIn { animation: zoomIn 0.8s ease forwards; }

@keyframes expandOpen {
    0% { transform: scale(1.5); opacity: 0; }
    50% { transform: scale(0.95); opacity: 1; }
    80% { transform: scale(1.05); }
    90% { transform: scale(0.98); }
    100% { transform: none; }
}
.expandOpen { animation: expandOpen 0.8s ease forwards; }

/* 动画延迟 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.5s; }
.delay-4 { animation-delay: 0.7s; }
.delay-5 { animation-delay: 0.9s; }
.delay-6 { animation-delay: 1.1s; }

/* ===== 测试题页面 ===== */
.quiz-page {
    position: relative;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

.quiz-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: background-color 0.4s ease;
}

.quiz-header,
.options,
.quiz-footer {
    position: relative;
    z-index: 1;
}

.quiz-header {
    width: 100%;
    flex-shrink: 0;
}

.quiz-header img {
    width: 100%;
    display: block;
}

/* 测试题入场动画 */
.quiz-header.quiz-anim {
    animation: slideDown 0.6s ease forwards;
}

.quiz-footer.quiz-anim {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.3s;
}

.option.quiz-anim {
    animation: slideUp 0.5s ease forwards;
}

.option.quiz-anim:nth-child(1) { animation-delay: 0.15s; }
.option.quiz-anim:nth-child(2) { animation-delay: 0.3s; }

.question-text {
    display: none;
}

.options {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2vh;
    justify-content: center;
    min-height: 0;
    padding: 0 1vw;
    overflow: hidden;
}

.option {
    width: 100%;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.option:active {
    transform: scale(0.97);
}

.option img {
    width: 100%;
    display: block;
    max-height: 100vh;
    object-fit: contain;
}

.quiz-footer {
    width: 100%;
    flex-shrink: 0;
}

.quiz-footer img {
    width: 100%;
    display: block;
}

/* ===== 结果页 ===== */
.result-page {
    background: #f5f5f5;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.result-content {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-image-wrapper {
    width: 100%;
    max-width: 480px;
    display: block;
    position: relative;
    margin: 0 auto;
}

.result-image {
    width: 100%;
    height: auto;
    display: block;
    animation: resultShow 0.8s ease forwards;
}

@keyframes resultShow {
    0% { opacity: 0; transform: scale(0.92) translateY(20px); }
    100% { opacity: 1; transform: none; }
}

.prizes {
    position: absolute;
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%);
    width: 78%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4%;
    z-index: 10;
}

.prize-item {
    width: 28%;
    max-width: 100px;
    flex: 0 0 auto;
    animation: swing 1s ease forwards;
    animation-delay: 0.5s;
    transform-origin: center center;
}

.prize-item:nth-child(1) { animation-delay: 0.5s; }
.prize-item:nth-child(2) { animation-delay: 0.7s; }
.prize-item:nth-child(3) { animation-delay: 0.9s; }

.prize-item img {
    width: 100%;
    display: block;
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in {
    animation: slideInRight 0.4s ease forwards;
}

/* ===== 适配小屏 ===== */
@media (max-height: 640px) {
    .cover-content {
        margin-top: -20px;
    }
    .logo {
        width: 55%;
    }
    .main-title {
        width: 80%;
    }
    .relics-collage {
        width: 75%;
    }
    .scroll-hint {
        bottom: 15px;
    }
}

@media (max-height: 568px) {
    .question-text {
        font-size: 14px;
        padding: 12px 16px;
        margin-bottom: 12px;
    }
    .options {
        gap: 10px;
    }
}
