* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}


body {
    background-color: #141414;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* 锁死手机外框视口，禁止整体滚动，完美适配真机 */
.phone-frame {
    width: 100%;
    height: 100dvh;
    max-width: 400px;
    background-color: #f7f5f0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 50% ;

    padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* 桌面端专属的手机外框及内部微调 */
@media (min-width: 500px) {
    .phone-frame {
        height: 90vh;
        max-height: 850px;
        aspect-ratio: 9 / 16;
        width: auto;
        border-radius: 36px;
        border: 10px solid #2a2a2a;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
        position: relative;
        overflow: hidden; /* 锁死内部，绝对不让内容溢出 */
        margin: 1% 0;
    }


    /* 1. 针对桌面端手机框内的首页按钮组间距调小，防止把文字和图片顶走 */
    .home-bottom-group {
        margin-bottom: 18% !important; /* 手机端可能用的是 40%，桌面端压短一点 */
    }

    /* 2. 针对桌面端引导页按钮组间距微调 */
    .intro-btn-wrapper {
        margin-bottom: 18% !important;
    }

    .q-header-art{
        padding-top: 2%;
    }

}

.hidden {
    display: none !important;
}

/* 2. 针对结果页顶部插画占位 */
.result-top-art {
    width: 100%;
    min-height: 220px;
    object-fit: contain;
}

/* 3. 全局所有自定义按钮里的 img 也加上防抖动占位 */
.custom-nav-btn img, .option-btn img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 导航图标按钮 (左上 Home & 右下 Back) */
.nav-top-left {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 100;
}

.nav-bottom-right {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 100;
}

.svg-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid #222;
    color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    background-color: rgba(255, 255, 255, 0.9);
}

.svg-icon-btn:active {
    transform: scale(0.92);
}

/* 语言切换按钮 */
.lang-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0);
    border: 1.5px solid #222;
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 800;
    color: #222;
    cursor: pointer;
}

.app-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* 页面通用容器：锁死 100dvh，保留你原本的 padding 视觉 */
.page {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* ================= 1. 首页 (Homepage) ================= */
.page-home {
    background-image: url('images/bg_home.png');
}

.home-center-art {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 105%;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
}

.overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 45px 20px 35px 20px; /* 保留你最初设定的首页 padding */
}

.flex-spacer {
    flex: 1;
    width: 100%;
}

.home-bottom-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom:10%; /* 保留你调好的 40% 黄金间距 */
    pointer-events: auto;
}

.home-subtitle {
    font-size: 20px; /* 保留你设定的字号 */
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px; /* 保留你设定的间距 */
    letter-spacing: 0.5px;
}

.action-btn {
    background-color: #00a859;
    color: #111111;
    border: 1.5px solid #111111;
    border-radius: 12px;
    padding: 12px 0px; /* 保留你设定的按钮内边距 */
    font-size: 30px; /* 保留你设定的按钮字号 */
    font-weight: 800;
    cursor: pointer;
    width: 65%;
    max-width: 250px;
    text-align: center;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.action-btn-intro.lang-eng {
    background-color: #00a859;
    color: #111111;
    border: 1.5px solid #111111;
    border-radius: 12px;
    padding: 12px 0px; /* 保留你设定的按钮内边距 */
    font-size: 18px; /* 保留你设定的按钮字号 */
    font-weight: 800;
    cursor: pointer;
    width: 80%;
    max-width: 250px;
    text-align: center;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.action-btn-intro.lang-cn {
    background-color: #00a859;
    color: #111111;
    border: 1.5px solid #111111;
    border-radius: 12px;
    padding: 12px 0px; /* 保留你设定的按钮内边距 */
    font-size: 25px; /* 保留你设定的按钮字号 */
    font-weight: 800;
    cursor: pointer;
    width: 65%;
    max-width: 250px;
    text-align: center;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.action-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #111111;
}

/* ================= 自定义 PNG 导航按钮样式 ================= */

/* 导航按钮容器位置保持不变 */
.nav-top-left {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 100;
}

.nav-bottom-right {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 100;
}

/* 基础导航按钮外观重置（去掉原本的边框和背景，让 PNG 图片完整呈现） */
.custom-nav-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
}

.custom-nav-btn:active {
    transform: scale(0.9); /* 点击时产生微小的缩放反馈 */
}

/* 内部图片自适应撑满 */
.custom-nav-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* --- 样式一：引导页的按钮尺寸与外观 --- */
.custom-nav-btn.style-1 {
    width: 40px;
    height: 40px;
}

/* --- 样式二：题目页的按钮尺寸与外观（如果你想让题目页的图标大一点或特效不同，可以在这里调） --- */
.custom-nav-btn.style-2 {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)); /* 题目页加一点专属阴影 */
}

/* --- 样式三：结果页专属的 Home 按钮 (Style 3) --- */
.result-home-btn.style-3 {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px; /* 你可以根据实际视觉大小自由微调 */
    height: 40px;
    z-index: 100;
}

/* ================= 2. 引导页 (Prologue Intro) ================= */
.page-intro {
    background-image: url('images/bg_intro.png');
}

.intro-header-art {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 105%;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
}

.intro-text-box {
    width: 85%;
    text-align: center;
    padding: 0 10px;
    margin-bottom: 8%; /* 保留你设定的文字框间距 */
    pointer-events: auto;
    z-index: 10;
}

.intro-text.lang-eng {
    font-size: 13px; /* 保留你设定的引导文字大小 */
    line-height: 1.6; /* 保留你设定的行高 */
    color: #1a1a1a;
    font-weight: 600;
}

.intro-text.lang-cn{
    font-size: 15px; /* 保留你设定的引导文字大小 */
    line-height: 1.5; /* 保留你设定的行高 */
    color: #1a1a1a;
    font-weight: 600;
}

.intro-btn-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 15%; /* 保留你调好的 40% 黄金间距 */
    pointer-events: auto;
    z-index: 10;
}

/* 短屏保护 (如 iPhone SE)：短屏自动将 margin 缩减至 20% 避免按钮顶到中间 */
@media (max-height: 700px) {
    .home-bottom-group, .intro-btn-wrapper {
        margin-bottom: 20%;
    }
}

/* ================= 3. 题目页 (Question Page) ================= */
.page-question {
    background-image: url('images/bg_question.png');
    justify-content: flex-start;
    padding: 0 20px; /* 保留你设定的题目页 padding */
    margin-top: auto;
}

.q-header-art {
    width: 100%;
    height: auto;
    object-fit: contain;
    margin-bottom: none;
    pointer-events: none;
    margin-top: 2%;
}

.q-text.lang-eng {
    font-size: 13px; /* 保留你设定的题目字号 */
    line-height: 1.55; /* 保留你设定的行高 */
    color: #1a1a1a;
    font-weight: 700;
    text-align: center;
    margin: 15px 0; /* 保留你设定的上下 margin */
    padding: 0 30px;
}

.q-text.lang-cn {
    font-size: 15px; /* 保留你设定的题目字号 */
    line-height: 1.55; /* 保留你设定的行高 */
    color: #1a1a1a;
    font-weight: 700;
    text-align: center;
    margin: 25px 0; /* 保留你设定的上下 margin */
    padding: 0 30px;
}

.options-list {
    width: 90%; /* 保留你设定的宽度 */
    display: flex;
    flex-direction: column;
    gap: auto; /* 保留你设定的选项间距 */
    margin-top: none;
    margin-bottom: auto;
}

.option-btn.lang-eng {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 12px 14px; /* 保留你设定的选项内边距 */
    font-size: 11px; /* 保留你设定的选项字号 */
    font-weight: 800;
    color: #dc2ac4;
    text-align: center;
    cursor: pointer;
}

.option-btn.lang-cn {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 12px 14px; /* 保留你设定的选项内边距 */
    font-size: 15px; /* 保留你设定的选项字号 */
    font-weight: 800;
    color: #dc2ac4;
    text-align: center;
    cursor: pointer;
}

.option-btn.selected {
    background-color: #ffffff;
    border: 2px solid #111111;
    color: #000000;
}

/* ================= 4. 结果页 (Result Page) ================= */
.page-result {
    background-image: url('images/bg_result.png');
    justify-content: flex-start;
    padding: 20px 18px 25px 18px; /* 保留你设定的结果页 padding */
    overflow-y: auto; /* 结果页内容较多，保留内部优雅滚动 */
}

.result-top-art {
    width: 100%;
    height: auto;
    object-fit: contain;
    margin-bottom: 10px;
    pointer-events: none;
}

.result-keywords {
    font-size: 15px; /* 保留你设定的关键词字号 */
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: auto;
    padding: 0px 20px;
    text-align: center;
    letter-spacing: 0.5px;
    max-height: 10vh;
}

.result-desc {
    font-size: 13px; /* 保留你设定的描述字号 */
    line-height: 1.6; /* 保留你设定的行高 */
    color: #2b2b2b;
    font-weight: 500;
    text-align: center;
    padding: 0 8px;
    margin-bottom: 2%; /* 保留你设定的间距 */
    padding: 0px 20px;
}

.rebirth-box {
    width: 100%;
    border: 1.8px solid var(--theme-color, #f26419);
    border-radius: 14px;
    padding: 25px 20px; /* 保留你设定的边距 */
    position: relative;
    margin: 15px 0 10px 0;
    text-align: center;
}

.rebirth-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--theme-color, #f26419);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    padding: 2px 14px;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.rebirth-quote {
    font-size: 16px; /* 保留你设定的宣言字号 */
    font-weight: 700;
    color: var(--theme-color, #f26419);
    line-height: 1.5;
    text-align: center;
}

/* 结果页底部整体容器 */
.result-bottom-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 16px 10px 16px;
    margin-top: auto;
}

/* 1. 活动资讯栏：使用人格专属主题色，文字设为白色以保证清晰度 */
.event-info-box {
    background-color: var(--theme-color, #28a745); /* 联动人格专属颜色 */
    color: #ffffff !important;
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.3;
}

.event-info-box.lang-eng{
    font-size: 13px;
}

.event-info-box.lang-cn{
    font-size: 15px;
}

.event-info-box .event-match-icon {
    width: 20px;
    height: auto;
    object-fit: contain;
}

.event-info-box .event-details {
    flex: 1;
}

.event-info-box{
    font-weight: 700;
    margin-bottom: 3px;
    color: #ffffff;
}

event-details-title {
    font-weight: 700;
    margin-bottom: 5px;
    color: #ffffff;
}

.event-info-box .event-text-sub {
    color: rgb(255, 255, 255);
}

/* 2. 下方并排行：确保二维码容器和 IG 按钮的高度完全一致（例如都设为 42px 左右） */
.qr-and-download-row {
    display: flex;
    align-items: stretch; /* 让左右两侧自动拉伸至同一高度 */
    gap: 8px;
}

/* 左侧 QR 框 */
.qr-container {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgb(0, 0, 0);
    box-sizing: border-box;
}

.qr-container .qr-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.qr-container .qr-label {
    font-size: 10px;
    color: #444;
    white-space: nowrap;
}

/* 右侧 IG 下载按钮：背景色与主题色一致，高度与左侧 QR 框完美融为一体 */
.ig-download-action-btn {
    flex: 1;
    background-color: var(--theme-color, #28a745); /* 严格联动人格主题色 */
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    box-sizing: border-box;
}

.ig-download-action-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* 定义淡入动画关键帧 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px); /* 伴随一点点极其微小的向上浮动，质感更好 */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 核心：每次渲染生成新页面时自动触发该动画 */
.page {
    animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 全屏预览遮罩层 */
#image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.25s ease;
}

#image-preview-modal img {
    max-width: 90%;
    max-height: 72vh;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    object-fit: contain;
}

.preview-tip {
    color: #ffffff;
    font-size: 13px;
    margin-top: 16px;
    text-align: center;
    font-weight: 500;
    line-height: 1.4;
}

.close-preview-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
}