/* ==========================================================================
   官网主页 - 太空星系主题
   深空蓝紫基调 + 霓虹星光点缀, 适配 PC 端与移动端
   ========================================================================== */

:root {
    /* 主题色 */
    --star: #7aa2ff;         /* 星蓝 */
    --star-light: #bcd4ff;
    --neon: #7de3ff;         /* 霓虹青 */
    --nebula: #b388ff;       /* 星云紫 */
    --space-0: #03040f;
    --space-1: #0a0e2a;
    --space-2: #111736;
    --text-dim: rgba(214, 224, 255, 0.6);
    --header-h: 64px;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
    background-color: var(--space-0);
    color: #e8eeff;
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

/* 全屏星空粒子画布 */
#starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ============================ 导航栏 ============================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* 刘海屏安全区适配: 高度随状态栏自动增加 */
    height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    z-index: 1000;
    /* 移动端部分浏览器不支持 backdrop-filter, 背景保持足够不透明度防止内容透出 */
    background: rgba(4, 6, 18, 0.85);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(122, 162, 255, 0.18);
    transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}

.site-header.scrolled {
    background: rgba(3, 4, 15, 0.96);
    border-bottom-color: rgba(122, 162, 255, 0.35);
}

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

.logo {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-en {
    background: linear-gradient(120deg, var(--neon), var(--star) 55%, var(--nebula));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-cn {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 4px;
    color: var(--text-dim);
}

.nav {
    display: flex;
    gap: 6px;
}

.nav-link {
    position: relative;
    padding: 8px 16px;
    font-size: 15px;
    letter-spacing: 2px;
    color: var(--text-dim);
    transition: color 0.3s;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 2px;
    height: 1px;
    background: linear-gradient(90deg, var(--neon), var(--nebula));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
}

.nav-link:hover,
.nav-link.active {
    color: var(--star-light);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* 汉堡按钮 */
.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(122, 162, 255, 0.4);
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--star-light);
    transition: transform 0.3s var(--ease), opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================ Hero 首屏 ============================ */
.hero {
    position: relative;
    height: 100vh;
    /* 移动端地址栏变化时以可视区为准, 避免首屏被浏览器 UI 遮挡 */
    height: 100svh;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

/* 首屏背景: 本地星云素材, 加载失败时渐变兜底 */
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(3, 4, 15, 0.2) 0%, rgba(3, 4, 15, 0.1) 45%, rgba(3, 4, 15, 0.85) 100%),
        linear-gradient(135deg, #070b24, #0c0a2e 55%, #04051a),
        url("../img/home/hero-bg.svg") center / cover no-repeat;
    animation: heroZoom 24s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes heroZoom {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.06);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 24px;
    animation: heroFadeIn 1.4s var(--ease) both;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-eyebrow {
    font-size: 13px;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: var(--neon);
    margin-bottom: 22px;
    text-shadow: 0 0 18px rgba(125, 227, 255, 0.45);
}

.hero-title {
    font-size: clamp(40px, 7.5vw, 76px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 12px;
    background: linear-gradient(180deg, #ffffff 20%, var(--star-light) 55%, var(--nebula));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 60px rgba(122, 162, 255, 0.25);
}

.hero-desc {
    margin-top: 26px;
    font-size: clamp(14px, 1.8vw, 17px);
    color: rgba(224, 232, 255, 0.82);
    letter-spacing: 2px;
    line-height: 2;
}

.hero-btn {
    position: relative;
    display: inline-block;
    margin-top: 42px;
    padding: 12px 38px;
    border: 1px solid var(--star);
    color: var(--star-light);
    font-size: 15px;
    letter-spacing: 4px;
    transition: all 0.35s var(--ease);
    overflow: hidden;
}

.hero-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(125, 227, 255, 0.35), rgba(179, 136, 255, 0.35));
    opacity: 0;
    transition: opacity 0.35s;
}

.hero-btn:hover {
    color: #ffffff;
    box-shadow: 0 0 30px rgba(122, 162, 255, 0.35), 0 8px 30px rgba(0, 0, 0, 0.4);
}

.hero-btn:hover::before {
    opacity: 1;
}

.hero-btn span {
    position: relative;
    z-index: 1;
}

/* 滚动指示 */
.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 22px;
    height: 36px;
    border: 1px solid rgba(224, 232, 255, 0.5);
    border-radius: 12px;
}

.hero-scroll::after {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 3px;
    height: 8px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--neon);
    box-shadow: 0 0 8px rgba(125, 227, 255, 0.8);
    animation: scrollHint 1.8s ease-in-out infinite;
}

@keyframes scrollHint {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    70% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 0;
    }
}

/* ============================ 通用区块 ============================ */
.section {
    position: relative;
    z-index: 1;
    padding: 96px 24px;
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section-head {
    text-align: center;
    margin-bottom: 56px;
}

.section-eyebrow {
    font-size: 12px;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--neon);
    margin-bottom: 14px;
    text-shadow: 0 0 14px rgba(125, 227, 255, 0.4);
}

.section-title {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 600;
    letter-spacing: 6px;
}

.section-title::after {
    content: "";
    display: block;
    width: 56px;
    height: 2px;
    margin: 18px auto 0;
    background: linear-gradient(90deg, transparent, var(--neon), var(--nebula), transparent);
    box-shadow: 0 0 12px rgba(125, 227, 255, 0.5);
}

.section-desc {
    margin-top: 14px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

/* ============================ 行星漫游 ============================ */
.planet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.card {
    background: linear-gradient(160deg, var(--space-2), var(--space-1));
    border: 1px solid rgba(122, 162, 255, 0.16);
    overflow: hidden;
    transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s;
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(125, 227, 255, 0.5);
    box-shadow: 0 0 40px rgba(122, 162, 255, 0.18), 0 20px 50px rgba(0, 0, 0, 0.5);
}

.card-img {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    /* 图片加载失败时的兜底背景 */
    background: radial-gradient(circle at 50% 45%, #1c2450, #0a0e2a);
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease);
}

.card:hover .card-img img {
    transform: scale(1.06);
}

.card-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 3px 12px;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--neon);
    background: rgba(4, 6, 18, 0.65);
    border: 1px solid rgba(125, 227, 255, 0.4);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.card-body {
    padding: 22px 24px 26px;
}

.card-body h3 {
    font-size: 20px;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.card-body p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.9;
}

/* ============================ 星辰大海横幅(视差) ============================ */
.banner {
    position: relative;
    z-index: 1;
    padding: 130px 24px;
    text-align: center;
    overflow: hidden;
}

.banner-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(3, 4, 15, 0.72), rgba(3, 4, 15, 0.72)),
        linear-gradient(135deg, #080b24, #0d0a30),
        url("../img/home/banner-bg.svg") center / cover no-repeat;
    /* PC 端视差效果 */
    background-attachment: fixed;
}

.banner-content {
    position: relative;
    z-index: 2;
}

.banner-quote {
    font-size: clamp(22px, 3.6vw, 34px);
    font-weight: 600;
    letter-spacing: 6px;
    line-height: 2;
    text-shadow: 0 0 40px rgba(122, 162, 255, 0.35);
}

.banner-cite {
    display: block;
    margin-top: 22px;
    font-size: 14px;
    font-style: normal;
    letter-spacing: 3px;
    color: var(--neon);
}

/* ============================ 星海探索 ============================ */
.explore {
    background: linear-gradient(180deg, var(--space-1), var(--space-0));
    border-top: 1px solid rgba(122, 162, 255, 0.1);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.feature {
    padding: 44px 32px;
    text-align: center;
    border: 1px solid rgba(122, 162, 255, 0.14);
    transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
}

.feature:hover {
    border-color: rgba(179, 136, 255, 0.5);
    background: rgba(122, 162, 255, 0.05);
    box-shadow: 0 0 30px rgba(179, 136, 255, 0.12);
}

.feature-char {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 20px;
    background: linear-gradient(120deg, var(--neon), var(--nebula));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.feature h3 {
    font-size: 19px;
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.feature p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 2;
}

/* ============================ 页脚 ============================ */
.site-footer {
    position: relative;
    z-index: 1;
    padding: 34px 24px;
    text-align: center;
    background: #02030c;
    border-top: 1px solid rgba(122, 162, 255, 0.14);
    color: var(--text-dim);
    font-size: 13px;
    letter-spacing: 1px;
}

.site-footer a {
    color: var(--star-light);
    transition: color 0.3s;
}

.site-footer a:hover {
    color: var(--neon);
}

.footer-beian {
    margin-top: 6px;
}

/* ============================ 滚动淡入动画 ============================ */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

/* ============================ 响应式适配 ============================ */
@media (max-width: 1024px) {
    .planet-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .section {
        padding: 64px 18px;
    }

    /* 汉堡菜单 */
    .nav-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
        left: 0;
        right: 0;
        z-index: 1001;
        flex-direction: column;
        gap: 0;
        background: rgba(3, 4, 15, 0.96);
        border-bottom: 1px solid rgba(122, 162, 255, 0.2);
        padding: 10px 24px 20px;
        /* 兜底: 不支持 calc + env 组合的浏览器仍能向上收起大部分 */
        transform: translateY(-110%);
        /* 精确隐藏: 上移自身高度 + 导航栏高度 + 安全区, 确保完全移出视口 */
        transform: translateY(calc(-100% - var(--header-h) - env(safe-area-inset-top, 0px)));
        visibility: hidden;
        transition: transform 0.4s var(--ease), visibility 0s linear 0.4s;
    }

    .nav.open {
        transform: translateY(0);
        visibility: visible;
        transition: transform 0.4s var(--ease), visibility 0s;
    }

    .nav-link {
        padding: 14px 8px;
        border-bottom: 1px dashed rgba(122, 162, 255, 0.15);
    }

    .nav-link::after {
        display: none;
    }

    .hero-title {
        letter-spacing: 6px;
    }

    .hero-eyebrow {
        letter-spacing: 5px;
    }

    .planet-grid {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    /* 移动端禁用背景视差, 防止滚动卡顿 */
    .banner-bg {
        background-attachment: scroll;
    }
}

/* 小屏手机微调 */
@media (max-width: 420px) {
    .logo-cn {
        display: none;
    }

    .section-title {
        letter-spacing: 3px;
    }

    .hero-title {
        letter-spacing: 4px;
    }

    .card-body {
        padding: 18px 18px 22px;
    }
}
