@charset "utf-8";

/* ============ 基础重置 ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: #e2ae70;
    color: #6b3b17;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

img {
    display: block;
    -webkit-user-drag: none;
    user-select: none;
}

/* ============ 主画布：严格按 1920 × 6500 设计稿等比缩放 ============ */
.page {
    width: 100%;
}

.stage {
    position: relative;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    aspect-ratio: 1920 / 6500;
    background: #e2ae70 url("https://static.web.sdo.com/mxdc/pic/project/20261109leaf/bg.jpg") no-repeat center top / 100% 100%;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 0 90px rgba(112, 58, 12, .16);
}

/* 所有素材层以百分比定位，保持与设计稿逐像素一致 */
.layer {
    position: absolute;
    will-change: transform, opacity;
}

.layer img {
    width: 100%;
    height: 100%;
    border: 0;
}

.hero-zone {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 13.8462%;
    z-index: 0;
    pointer-events: none;
}

.decor {
    z-index: 1;
    pointer-events: none;
}

.hero-role {
    z-index: 2;
}

.hero-logo {
    z-index: 3;
}

.hero-tips {
    z-index: 4;
}

.panel {
    z-index: 5;
}

/* 卡片悬停微浮起（GSAP 作用于外层，不会与内层 transform 冲突） */
.panel img {
    transition: transform .45s cubic-bezier(.22, 1, .36, 1), filter .45s ease;
}

@media (hover: hover) {
    .panel:hover img {
        transform: translateY(-6px) scale(1.006);
        filter: drop-shadow(0 16px 20px rgba(104, 55, 20, .24));
    }
}

/* ============ 特效层 ============ */
/* 星点图层：原图 1920 × 841，在设计稿首屏顶部 */
.star-field,
.fx-leaves {
    position: absolute;
    pointer-events: none;
}

.star-field {
    left: 0;
    top: 0;
    width: 100%;
    height: 12.9385%;
    z-index: 6;
    will-change: transform;
}

.star-layer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    will-change: opacity;
}

/* 底光常亮 0.25 + 分组峰值 0.75 = 原图亮度，闪烁时只变暗不会过曝 */
.star-base {
    opacity: .25;
}

.star-group {
    opacity: .75;
}

.fx-leaves {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.ambient-leaf {
    position: absolute;
    width: 2.2%;
    height: auto;
    opacity: .28;
    will-change: transform, opacity;
}

/* GSAP 未加载时：星点保持静态原图，仅隐藏纯装饰性飘叶 */
.no-gsap .fx-leaves {
    display: none;
}

/* ============ 滚动进度条 ============ */
.scroll-progress {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 4px;
    z-index: 100;
    background: rgba(255, 255, 255, .22);
    pointer-events: none;
}

.scroll-progress__bar {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    background: linear-gradient(90deg, #ef8531 0%, #ffd159 48%, #7ebb3d 100%);
    box-shadow: 0 0 12px rgba(255, 186, 70, .8);
}

/* ============ 回到顶部 ============ */
.to-top {
    position: fixed;
    right: 24px;
    bottom: 26px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 15px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #e17a2b, #f4a63f);
    color: #fff;
    font: 700 13px/1 "Microsoft YaHei", "PingFang SC", sans-serif;
    letter-spacing: .06em;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(130, 63, 12, .3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(.9);
    transition: opacity .3s ease, transform .35s cubic-bezier(.22, 1, .36, 1), visibility .3s, box-shadow .3s;
}

.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.to-top:hover {
    box-shadow: 0 10px 28px rgba(130, 63, 12, .42);
}

.to-top:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .to-top {
        right: 12px;
        bottom: 14px;
        padding: 8px 11px;
        font-size: 12px;
    }

    .scroll-progress {
        height: 3px;
    }
}

/* ============ 无障碍：减少动态效果 ============ */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .layer,
    .panel img,
    .star-layer,
    .ambient-leaf {
        transition: none !important;
        animation: none !important;
    }

    .ambient-leaf {
        display: none;
    }
}
