/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #000;
}

/* 玄学 Loading 样式 */
.loading-container {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #0a0e14 0%, #000 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: #54FF9A;
}

.mystic-orb-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 40px;
}

.mystic-aura {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(84, 255, 154, 0.15) 0%, transparent 70%);
    animation: aura-pulse 3s ease-in-out infinite;
}

.mystic-symbol {
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(84, 255, 154, 0.4);
    border-radius: 50%;
    animation: rotate-mystic 10s linear infinite;
}

.mystic-symbol::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(84, 255, 154, 0.8);
    border-radius: 50%;
    box-shadow: inset 0 0 15px rgba(84, 255, 154, 0.3);
}

.mystic-text {
    font-size: 14px;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(84, 255, 154, 0.6);
    text-align: center;
}

.mystic-progress-container {
    width: 180px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 auto;
}

.mystic-progress-bar {
    width: 0%;
    height: 100%;
    background: #54FF9A;
    box-shadow: 0 0 10px #54FF9A;
    transition: width 0.3s ease;
}

/* 布局控制 */
.background-layer {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    margin: 0 auto;
}

.main-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* 3D 透视头像 */
.avatar-perspective-container {
    position: absolute;
    inset: 0;
    z-index: 5;
    transform-origin: 0 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    isolation: isolate;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='0' width='10' height='10' rx='0.77' fill='black'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='0' width='10' height='10' rx='0.77' fill='black'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

/* 底部交互区 */
.content-overlay {
    position: absolute;
    bottom: 9.28%;
    left: 0;
    z-index: 10;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-overlay.is-not-wechat {
    bottom: 10.52%;
}

.analysis-btn-wrapper {
    display: block;
    width: 59.67%;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.analysis-btn-img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0px 0px 20px rgba(65, 0, 162, 0.2));
}

.analysis-btn-wrapper:active {
    transform: scale(0.95);
}

.privacy-container {
    margin-top: 20px;
    display: flex;
    align-items: center;
    filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.2));
}

.privacy-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.check-icon {
    width: 100%;
    height: auto;
}

.privacy-text {
    margin-left: 5px;
    font-size: 12px;
    font-weight: 400;
    color: #fff;
    white-space: nowrap;
}

.protocol-link {
    color: #D7FFA6;
    font-weight: 900;
    text-decoration: none;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.modal-content {
    width: 85.5%;
    height: 27.48vh;
    margin-bottom: 9vh;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(150, 255, 201, 0.5);
    border: 3px solid #96FFC9;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-title-img {
    height: 18%;
    margin-top: calc(27.48vh * 0.1712);
}

.modal-body-text {
    flex: 1;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #222;
}

.modal-link {
    color: #00A05D;
    font-weight: 500;
    text-decoration: none;
}

.modal-btn {
    width: 88.7%;
    height: 50px;
    margin-bottom: 20px;
    background-color: #000;
    color: #54ff9a;
    font-size: 16px;
    font-weight: 900;
    border-radius: 25px;
    border: none;
}

/* 动画库 */
@keyframes rotate-mystic { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes aura-pulse { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.2); opacity: 0.8; } }

/* 性别选择页专属样式 */
.gender-selection-container {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* AI 分析状态下的元素 */
.analysis-elements {
    position: absolute;
    inset: 0;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease 0.3s;
}

.analysis-elements.show {
    opacity: 1;
}

.gender-sticker-img {
    position: absolute;
    top: 59.9%;
    left: 50%;
    transform: translateX(-50%);
    width: 38.65%;
    height: auto;
}

.progress-container {
    position: absolute;
    top: 73.51%;
    left: 50%;
    transform: translateX(-50%);
    width: 66.18%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-bar-bg {
    width: 100%;
    height: 5px;
    background: rgba(181, 153, 110, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: #B5996E;
    border-radius: 10px;
    transition: width 0.1s linear;
}

.progress-text {
    margin-top: 15px;
    font-size: 14px;
    line-height: 14px;
    color: #876D46;
    font-family: system-ui, -apple-system, sans-serif;
    white-space: nowrap;
}

.analysis-bg-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.50) 0%, #FFF 29.15%);
    z-index: 2;
    transition: 
        top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        right 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        bottom 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-radius 0.6s ease;
}

.analysis-bg-mask.is-analyzing {
    top: 12.87%;
    left: 9.66%;
    right: 9.66%;
    bottom: 18.57%;
    border-radius: 50px;
    border: 2px solid #FFF;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.50) 0%, #FFF 55.08%);
    box-shadow: 0 0 20px 0 #FFF inset, 0 0 30px 0 rgba(184, 129, 0, 0.50);
}

@media screen and (min-width: 768px) {
    .analysis-bg-mask.is-analyzing {
        left: 50%;
        transform: translateX(-50%);
    }
}

.gender-title-wrapper {
    margin-top: 28.47vh;
    width: 100%;
    z-index: 5;
    display: flex;
    justify-content: center;
}

.gender-title-img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.gender-options-group {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 15.46%;
    z-index: 5;
    width: 100%;
}

.gender-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    width: 18.6075%;
}

.gender-avatar-img {
    width: 100%;
    height: auto;
    transition: transform 0.2s ease;
}

.gender-card.active .gender-avatar-img {
    transform: scale(1.05);
    filter: drop-shadow(0px 0px 10px rgba(178, 145, 119, 0.3));
}

/* -----------------------------------------------------------
   结果页样式 (长页面瀑布流)
   ----------------------------------------------------------- */

.result-body {
    overflow-y: auto !important;
    background-color: #f4f4f4;
}

/* 结果页下强制开启 html 滚动 */
html:has(.result-body) {
    overflow-y: auto !important;
    height: auto !important;
}

.result-page-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 125px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: url('../img/分析_bg.png'), url('../img/结果_bg.png');
    background-repeat: no-repeat, repeat-y;
    background-position: top center, top center;
    background-size: 100% auto, 100% auto;
}

@media screen and (min-width: 768px) {
    .result-page-container {
        width: calc(100vh * (414 / 808));
        margin: 0 auto;
    }
}

.analysis-main-card {
    margin-top: 41px;
    width: 81.64%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    border: 2px solid #FFF894;
    box-shadow: 0 0 20px 0 #FFF inset, 0 0 30px 0 rgba(184, 129, 0, 0.50);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 40px;
}

.analysis-main-card.next-module {
    margin-top: 40px;
}

.module-title-img {
    width: 100%;
    height: auto;
    margin-top: 38px;
    display: block;
}

.analysis-card-header {
    width: 100%;
    position: relative;
}

.analysis-header-bg {
    width: 100%;
    height: auto;
    display: block;
}

.analysis-header-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-avatar-wrapper {
    width: 23.66%;
    aspect-ratio: 1 / 1;
    border-radius: 5px;
    padding: 3px;
    background-image: linear-gradient(#fff, #fff), linear-gradient(to bottom, #AF7D1E, #382D25);
    background-origin: border-box;
    background-clip: content-box, border-box;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.analysis-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.analysis-gender-icon {
    position: absolute;
    right: 21%; 
    width: 11.24%;
    height: auto;
    filter: drop-shadow(0px 0px 10px rgba(115, 57, 0, 0.25));
    z-index: 3;
}

.analysis-body-wrap {
    width: 100%;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.00) 0%, #FFF 5.93%, #FFF 94.12%, rgba(255, 255, 255, 0.00) 100%);
    filter: drop-shadow(0 0 10px rgba(201, 201, 201, 0.50));
    display: flex;
    flex-direction: column;
}

.next-module {
    padding-top: 38px;
}

.next-module .analysis-body-wrap {
    margin-top: 0;
}

.analysis-subtitle-img, 
.module-title-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

.analysis-text-box {
    width: 100%;
    padding: 30px 40px 30px 40px;
}

.analysis-text-content {
    font-size: 16px;
    line-height: 24px;
    color: #222222;
    text-align: justify;
    font-family: system-ui, -apple-system, sans-serif;
}

.analysis-text-content strong {
    color: #000;
    font-weight: 900;
}

.analysis-text-content p {
    margin-bottom: 24px;
}

.analysis-text-content p:last-child {
    margin-bottom: 0;
}

.ai-suggestion-section {
    margin-top: 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ai-icon-img {
    width: 100%;
    height: auto;
    z-index: 2;
}

.ai-suggestion-card {
    width: 81.64%;
    background: #222222;
    border-radius: 10px;
    padding: 20px 20px 30px 20px;
    margin-top: -7px;
    z-index: 1;
}

.ai-suggestion-text {
    font-size: 16px;
    line-height: 24px;
    color: #FFFFFF;
    font-family: system-ui, -apple-system, sans-serif;
    text-align: justify;
}

.ai-suggestion-text p {
    margin-bottom: 20px;
}

.ai-suggestion-text p:last-child {
    margin-bottom: 0;
}

.highlight-green {
    color: #54FF9A;
    font-weight: 900;
}

.highlight-bold {
    font-weight: 900;
}

.unlock-btn {
    width: 75.15%;
    height: 50px;
    background: #54FF9A;
    border-radius: 28px;
    box-shadow: 0 0 10px 0 rgba(206, 255, 226, 0.50);
    margin: 30px auto 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #000000;
    font-size: 16px;
    font-weight: 900;
    line-height: 24px;
    cursor: pointer;
    border: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease;
}

.unlock-btn:active {
    transform: scale(0.95);
}

.unpaid-module-card {
    margin-top: 40px;
    width: 81.64%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    border: 2px solid #FFF894;
    box-shadow: 0 0 20px 0 #FFF inset, 0 0 30px 0 rgba(184, 129, 0, 0.50);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 38px;
    padding-bottom: 30px;
}

.unpaid-title-img {
    width: 100%;
    height: auto;
    display: block;
}

.unpaid-button-row {
    width: 80.483%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
}

.unpaid-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-family: system-ui, -apple-system, sans-serif;
    cursor: pointer;
    border: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease;
}

.unpaid-btn:active {
    transform: scale(0.95);
}

.btn-invite {
    width: 58.09%;
    height: 42px;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 0 5px 0 rgba(140, 110, 33, 0.20);
    color: #888888;
}

.btn-pay {
    width: 34.56%;
    height: 42px;
    background: #222222;
    border-radius: 25px;
    color: #A2EFFF;
}

.customer-service-section {
    margin-top: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.qr-code-img {
    width: 45.89%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(184, 129, 0, 0.50));
    border-radius: 10px;
}

.icp-footer {
    margin-top: 30px;
    width: 100%;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    color: #ffffff;
    font-family: system-ui, -apple-system, sans-serif;
    opacity: 0.8;
}

/* -----------------------------------------------------------
   6. 吸顶 & 吸底样式
   ----------------------------------------------------------- */

/* 吸顶 */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(144, 111, 39, 0.5);
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #FFFDE0;
}

@media screen and (min-width: 768px) {
    .sticky-header {
        width: calc(100vh * (414 / 808));
        left: 50%;
        transform: translate(-50%, -100%);
    }
    .sticky-header.visible {
        transform: translate(-50%, 0) !important;
    }
}

.sticky-header.visible {
    transform: translateY(0);
    pointer-events: auto;
}

.header-bg {
    width: 100%;
    height: auto;
    display: block;
}

.header-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 500;
}

/* 吸底 */
.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

@media screen and (min-width: 768px) {
    .sticky-footer {
        width: calc(100vh * (414 / 808));
        left: 50%;
        transform: translateX(-50%);
    }
}

.footer-bg {
    width: 100%;
    height: auto;
    display: block;
}

.footer-btn {
    position: absolute;
    bottom: 19.19%;
    right: 4.83%;
    width: 30%;
    height: 42px;
    background: #ff4545;
    color: #ffffff;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s;
}

.footer-btn:active {
    transform: scale(0.95);
}
