@import 'modules/sleepBetter/sleepBetter.css';
@import 'modules/ourProducts/ourProducts.css';
@import 'modules/builtAround/builtAround.css';
@import 'modules/scientifically/scientifically.css';
@import 'modules/actualAxiSleep/actualAxiSleep.css';
@import 'modules/behindAxi/behindAxi.css';
@import 'modules/stillWaking/stillWaking.css';

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

body {
    background-color: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ================= 主 View（Web 默认） ================= */
.main-view {
    position: relative;
    width: 100%;
    min-height: 100vh;

    background-image:
        url('images/web_bg_shadow_top.png'),
        url('images/web_top_bg.png'),
        url('images/web_bg_shadow_right.png'),
        url('images/web_bg_shadow_left.png'),
        url('images/web_center_bg.png'),
        url('images/web_bg_shadow_right.png'),
        url('images/web_bottom_bg.png');

    background-repeat: no-repeat;

    background-size:
        100% auto,
        100% auto,
        60% auto,
        60% auto,
        100% auto,
        60% auto,
        100% auto;

    background-position:
        top center,
        center 73px,
        right 1400px,
        left 2100px,
        center 3350px,
        right 4700px,
        bottom left;
}

/* ================= Navbar ================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
}

.nav-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.axi-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.nav-cta {
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: transparent;
    color: #fff;
    font-family: 'Avenir', -apple-system, sans-serif;
    font-weight: 500;
    font-size: 18px;
    padding: 12px 20px;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.nav-cta:hover {
    opacity: 0.85;
}

/* ================= Content ================= */
.content-bg-view {
    width: 1200px;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.module-container {
    margin-top: 160px;
    width: 100%;
}

.module-container[data-module="sleepBetter"] {
    margin-top: 73px;
}

/* ================= H5 适配 ================= */
@media (max-width: 1024px) {

    /* ===== 核心变量 ===== */
    :root {
        --center-scale: 1;        /* 缩放 */
        --center-offset: 1;       /* 位置 */
    }

    .navbar {
        height: 54px;
    }

    .axi-logo {
        height: 28px;
    }

    .nav-cta {
        font-size: 14px;
        padding: 8px 12px;
        white-space: nowrap;
    }

    /* ===== H5 背景 ===== */
    .main-view {
        background-image:
            url('images/web_bg_shadow_top_h5.png'),
            url('images/web_top_bg.png'),
            url('images/web_bg_shadow_right_h5.png'),
            url('images/web_bg_shadow_left_h5.png'),
            url('images/web_center_bg_h5.png'),
            url('images/web_bg_shadow_bottom_left_h5.png'),
            url('images/web_bottom_bg_h5.png');

        background-repeat: no-repeat;

        /* 第5张图单独 scale */
        background-size:
            100% auto,
            100% auto,
            100% auto,
            100% auto,
            calc(100% * var(--center-scale)) auto,
            100% auto,
            100% auto;

        /* 第5张图单独 offset */
        background-position:
            top center,
            center 72px,
            center 1200px,
            center 2600px,
            center calc(3500px * var(--center-offset)),
            center 5300px,
            bottom center;
    }

    .module-container {
        margin-top: 80px;
    }

    .module-container[data-module="sleepBetter"] {
        margin-top: 55px;
    }
}

/* ================= center 图单独适配设备 ================= */

/* iPhone SE */
@media (max-width: 1024px) and (max-height: 700px) {
    :root { 
        --center-scale: 1.02;
        --center-offset: 1.02;
    }
}

/* iPhone XR */
@media (max-width: 1024px) and (min-height: 701px) and (max-height: 820px) {
    :root { 
        --center-scale: 1.0;
        --center-offset: 1.0; /* 🔹 调整后，使 XR 显示正常 */
    }
}

/* iPhone 12 Pro */
@media (max-width: 1024px) and (min-height: 821px) and (max-height: 900px) {
    :root { 
        --center-scale: 1.0;
        --center-offset: 1.02;
    }
}

/* iPhone 17 / 17 Pro / 17 Pro Max */
@media (max-width: 1024px) and (min-height: 980px) {
    :root { 
        --center-scale: 1.05;
        --center-offset: 1.1;
    }
}
