/* 重置默认边距 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background-color: #333;
    position: relative;
    font-family: 'Arial', sans-serif; /* 建议添加字体 */
}

/*
   背景层动画 + 视差效果
*/
body::before {
    content: '';
    position: absolute;
    background-image: url('../img/111.jpg');
    background-size: cover;
    background-repeat: no-repeat;

    animation: bgRiseAndFadeIn 2.5s ease-out forwards;
    z-index: 0;

    /* 视差效果 - 与 overlay 同步移动 */
    background-position: calc(50% + var(--parallax-x, 0px)) calc(50% + var(--parallax-y, 0px) + 50px);
    transition: background-position 0.1s ease-out;
}

@keyframes bgRiseAndFadeIn {
    0% {
        transform: translateY(-20%);
        top: -10%;
        left: -10%;
        width: 120%;
        height: 150%;
        opacity: 0;
    }
    100% {
        transform: translateY(0%);
        top:0;
        left: -10%;
        width: 120%;
        height: 120%;
        opacity: 1;
    }
}

/* 白色蒙版层 - 原始手电筒效果 */
.overlay {
    position: absolute;
    background-image: url('../img/222.jpg');
    background-size: cover;
    background-repeat: no-repeat;

    transform: translateY(100%);
    opacity: 0;

    animation: bgRiseAndFadeIn 2.5s ease-out forwards;
    z-index: 100;

    mask-image: radial-gradient(
        circle 800px at var(--x) var(--y),
        transparent 0%,
        transparent 50%,
        black 100%
    );

    will-change: transform;

    background-position: calc(50% + var(--parallax-x, 0px)) calc(50% + var(--parallax-y, 0px) + 50px);
    transition: background-position 0.1s ease-out;
}

/* 鱼眼/透镜效果层 - 增强版 */
.lens-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    pointer-events: none;
    z-index: 200;

    mask-image: radial-gradient(
        circle 500px at var(--lx) var(--ly),
        /*black 0%,*/
        /*black 55%,*/
        rgba(0, 0, 0, 0.1) 75%,
        rgba(0, 0, 0, 0.8) 100%
    );

    /* 外部区域强模糊 */
    backdrop-filter: blur(var(--blur, 8px));
    -webkit-backdrop-filter: blur(var(--blur, 8px));

    /* 平滑过渡 */
    transition: mask-image 0.2s ease, backdrop-filter 0.2s ease;
    will-change: --lx, --ly, --ls, --blur;
}


header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    position: fixed;
    top: -40px;
    width: 101%;
    z-index: 500;
    background-color: rgba(255, 255, 255,0.4);
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease;
    /* 可选：让 header 也稍微有个淡入效果，但不影响主逻辑 */
    animation: simpleFadeIn 1s ease-out 2.6s forwards;
    opacity: 0; /* 初始隐藏 */
}

@keyframes simpleFadeIn {
    to {opacity: 1;
        top:0;}
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #ecf5ff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 40px;
    width: auto;
    display: inline-block;
}

.logo-icon {
    display: none;
}

nav{
    display: flex;
    justify-content:space-between;

}

nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 20px;
}

nav ul li a {
    text-decoration: none;
    color:rgba(255,255,255,1);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 25px;
    background-color: transparent;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    background-color: rgba(0,0,0, 0.2);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.search{
    width: 350px;
}

.search input{
    border: none;
    text-decoration: none;
    color:rgba(255,255,255,1);
    background-color: rgba(0,0,0, 0.1);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);}

.search input:focus{
    outline: none;
}



.search-button{
    border: none;
    text-decoration: none;
    color:rgba(255,255,255,1);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 25px;
    background-color: rgba(0,0,0, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
}


.search-button:hover{
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.2);
}


/* --- 内容区域动画修改开始 --- */

.content {
    /* 使用 Flex 布局让内容垂直居中，然后整体稍微向下偏移 */
    display: flex;
    flex-direction: column;
    align-items: center; /* 水平居中 */
    justify-content: center; /* 垂直居中基准 */

    height: 100vh; /* 占满视口高度以便控制位置 */
    width: 100%;
    padding: 20px;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1001; /* 高于透镜层，确保文字清晰 */
    pointer-events: none; /* 允许点击穿透到下方元素 */

    /* 关键：整体向下偏移 10%，实现"正中偏下"的效果 */
    transform: translateY(10%);
}

/* 通用上浮淡入动画 */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 标题 */
.content h1 {
    font-size: 80px;
    line-height: 1.2;
    text-align: center;
    margin-bottom: 20px;

    /* 延迟 2.7s 出现 */
    animation: fadeInUp 1s ease-out 2.7s forwards;
    opacity: 0;
}

/* 副标题 */
.content p {
    font-size: 24px;
    font-weight: 300;
    text-align: center;
    max-width: 600px;
    margin-bottom: 40px; /* 增加与按钮的间距 */

    /* 延迟 3.0s 出现 */
    animation: fadeInUp 1s ease-out 3.0s forwards;
    opacity: 0;
}

/* 【新增】了解产品 按钮样式 */
.cta-button {
    display: inline-block;
    text-decoration: none;
    color: rgba(0,0,0,1);
    font-size: 18px;
    font-weight: 600;
    padding: 15px 40px;
    border-radius: 50px;
    z-index: 500;
    pointer-events: auto; /* 恢复点击 */

    /* 白色半透明背景 + 毛玻璃效果 */
    background-color: rgba(255,255,255,0.4);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0,255,255,1);

    box-shadow: 0 4px 15px rgba(0,0,0,1);
    transition: all 0.3s ease;

    /* 初始状态隐藏，准备动画 */
    opacity: 0;

    /* 【关键】延迟 3.3s 出现，接在文字之后 */
    animation: fadeInUp 1s ease-out 3.3s forwards;
}

/* 按钮悬停效果 */
.cta-button:hover {
    background-color: rgba(255,255,255,1); /* 变完全不透明 */
    transform: translateY(-3px) scale(1.02); /* 微微上浮并放大 */
    box-shadow: 0 8px 25px rgba(255,255,255,1);
    color: rgba(0,0,0,1);
}

.cta-button:active {
    transform: translateY(1px);
}


/* ================== 移动端适配（响应式） ================== */

/* 平板及以下 */
@media (max-width: 768px) {
    header {
        padding: 12px 20px;
        width: 100%; /* 修复 101% 导致的横向滚动 */
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .logo {
        font-size: 20px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
    }

    nav {
        width: 100%;
        flex-direction: column;
        gap: 15px;
    }

    .search {
        width: 100%; /* 不再固定 350px */
        display: flex;
        gap: 8px;
    }

    .search input,
    .search-button {
        padding: 10px 16px;
        font-size: 16px; /* 避免 iOS 缩放 */
        flex: 1;
        border-radius: 20px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    nav ul li a {
        padding: 8px 16px;
        font-size: 16px;
    }

    /* 内容区域 */
    .content {
        transform: translateY(5%); /* 减少偏移 */
        padding: 0 20px;
    }

    .content h1 {
        font-size: 48px; /* 手机端缩小标题 */
        margin-bottom: 16px;
    }

    .content p {
        font-size: 18px;
        margin-bottom: 30px;
    }

    .cta-button {
        padding: 12px 30px;
        font-size: 16px;
        width: auto;
    }
}

/* 手机竖屏（更小屏幕） */
@media (max-width: 480px) {
    .content h1 {
        font-size: 36px;
    }

    .content p {
        font-size: 16px;
    }

    header {
        padding: 10px 15px;
    }

    .logo {
        font-size: 18px;
    }

    .search input,
    .search-button {
        padding: 9px 14px;
        font-size: 16px;
    }

    nav ul li a {
        padding: 6px 12px;
        font-size: 14px;
    }
}
