/* ============================================================
   星林互娱官网全局样式
   风格：深色科技风 | 布局：单页长滚动
   组织结构：变量 -> 基础重置 -> 通用组件 -> 各区块 -> 响应式
   ============================================================ */

/* ==================== 1. 设计变量 ==================== */
:root {
    /* 背景色系：深蓝黑渐变基调 */
    --bg-primary: #0a0e1a;        /* 页面主背景 */
    --bg-secondary: #0d1322;      /* 交替区块背景 */
    --bg-card: #111827;           /* 卡片背景 */
    --bg-card-hover: #151d30;     /* 卡片悬停背景 */

    /* 主色系：青蓝到紫的渐变，体现 AI 科技调性 */
    --accent-cyan: #38bdf8;
    --accent-purple: #a78bfa;
    --accent-blue: #60a5fa;
    --gradient-main: linear-gradient(135deg, #38bdf8 0%, #a78bfa 100%);

    /* 文字色系 */
    --text-primary: #e8ecf4;      /* 主文字 */
    --text-secondary: #9aa5bd;    /* 次级文字 */
    --text-muted: #6b7590;        /* 弱化文字 */

    /* 边框与光效 */
    --border-color: rgba(148, 163, 184, 0.12);
    --glow-cyan: rgba(56, 189, 248, 0.35);
    --glow-purple: rgba(167, 139, 250, 0.35);

    /* 导航栏高度：用于锚点滚动偏移补偿 */
    --navbar-height: 72px;

    /* 通用圆角与过渡 */
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: 0.3s ease;
}

/* ==================== 2. 基础重置 ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* 锚点跳转时自动补偿导航栏高度 */
    scroll-behavior: smooth;
    scroll-padding-top: var(--navbar-height);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    /* 防止横向滚动溢出 */
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

img,
svg {
    display: block;
    max-width: 100%;
}

/* 统一聚焦轮廓，兼顾无障碍访问 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* ==================== 3. 通用组件 ==================== */

/* 内容容器：限制最大宽度并居中 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 区块通用外边距 */
.section {
    padding: 100px 0;
}

/* 交替区块：略深的背景色用于区分层次 */
.section-alt {
    background-color: var(--bg-secondary);
}

/* 区块标题组件：标签 + 标题 + 描述 */
.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--accent-cyan);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 16px;
}

/* 渐变高亮文字：用于标题关键词 */
.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* 按钮基础样式 */
.btn {
    display: inline-block;
    padding: 13px 34px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: transform var(--transition), box-shadow var(--transition),
        background-color var(--transition), border-color var(--transition);
}

/* 主按钮：渐变底 + 发光阴影 */
.btn-primary {
    background: var(--gradient-main);
    color: #0a0e1a;
    box-shadow: 0 4px 24px var(--glow-cyan);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--glow-cyan);
}

/* 幽灵按钮：透明底 + 描边 */
.btn-ghost {
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: var(--text-primary);
}

.btn-ghost:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: translateY(-2px);
}

/* 滚动渐显动画：初始状态隐藏，.visible 类由 JS 添加后显现 */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== 4. 顶部导航栏 ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--navbar-height);
    transition: background-color var(--transition), box-shadow var(--transition);
}

/* 滚动后状态：由 JS 添加 .scrolled 类，呈现毛玻璃效果 */
.navbar.scrolled {
    background-color: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 var(--border-color);
}

.navbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo：图标 + 文字 */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 34px;
    height: 34px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 导航链接 */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    position: relative;
    padding: 8px 16px;
    font-size: 15px;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
}

/* 当前区块高亮：渐变下划线指示 */
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--gradient-main);
}

/* 移动端汉堡按钮：默认隐藏，小屏显示 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background-color: var(--text-primary);
    transition: transform var(--transition), opacity var(--transition);
}

/* 汉堡按钮展开态：三条线变为 X 形 */
.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==================== 5. Hero 首屏 ==================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 粒子画布：铺满整个首屏 */
#particleCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* 渐变遮罩：压暗边缘突出中心文字 */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
            transparent 0%,
            rgba(10, 14, 26, 0.55) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-top: var(--navbar-height);
}

/* 资质徽章 */
.hero-badge {
    display: inline-block;
    padding: 7px 20px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--accent-cyan);
    border: 1px solid rgba(56, 189, 248, 0.35);
    background-color: rgba(56, 189, 248, 0.08);
    margin-bottom: 28px;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 3px;
    margin-bottom: 24px;
}

.hero-subtitle {
    max-width: 640px;
    margin: 0 auto 40px;
    font-size: 17px;
    color: var(--text-secondary);
}

/* CTA 按钮组 */
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* 向下滚动指示器：鼠标造型动画 */
.scroll-indicator {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.scroll-mouse {
    display: block;
    width: 26px;
    height: 42px;
    border: 2px solid var(--text-secondary);
    border-radius: 14px;
    position: relative;
}

/* 鼠标内的滚轮圆点：循环下落动画 */
.scroll-mouse::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: var(--accent-cyan);
    animation: scrollWheel 1.8s ease-in-out infinite;
}

@keyframes scrollWheel {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    70% {
        opacity: 0;
        transform: translateY(14px);
    }
    100% {
        opacity: 0;
        transform: translateY(0);
    }
}

/* ==================== 6. 关于我们 ==================== */
.about-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 56px;
    align-items: center;
}

.about-heading {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 15.5px;
}

.about-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 资质标签组 */
.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.tag {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--accent-purple);
    border: 1px solid rgba(167, 139, 250, 0.35);
    background-color: rgba(167, 139, 250, 0.08);
}

/* 数据统计卡片：桌面端 3 列排布 */
.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    padding: 30px 24px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform var(--transition), border-color var(--transition),
        box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.stat-number {
    font-size: 40px;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-suffix {
    font-size: 24px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

/* ==================== 7. 三大技术板块 ==================== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.tech-card {
    position: relative;
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition),
        box-shadow var(--transition), background-color var(--transition);
}

/* 悬停效果：上浮 + 发光边框 */
.tech-card:hover {
    transform: translateY(-8px);
    background-color: var(--bg-card-hover);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 32px rgba(56, 189, 248, 0.12);
}

/* 卡片顶部渐变光条：不同卡片使用不同主色 */
.tech-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.85;
}

.tech-glow-cyan {
    background: linear-gradient(90deg, #38bdf8, #22d3ee);
}

.tech-glow-purple {
    background: linear-gradient(90deg, #a78bfa, #e879f9);
}

.tech-glow-blue {
    background: linear-gradient(90deg, #60a5fa, #38bdf8);
}

/* 技术图标容器 */
.tech-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-bottom: 24px;
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
    transition: transform var(--transition);
}

.tech-card:hover .tech-icon {
    transform: scale(1.08);
}

.tech-icon svg {
    width: 40px;
    height: 40px;
}

/* 为三张卡片分别设置图标主色 */
.tech-card:nth-child(1) .tech-icon {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
}

.tech-card:nth-child(2) .tech-icon {
    background-color: rgba(167, 139, 250, 0.12);
    color: var(--accent-purple);
}

.tech-card:nth-child(3) .tech-icon {
    background-color: rgba(96, 165, 250, 0.12);
    color: var(--accent-blue);
}

.tech-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 14px;
}

.tech-desc {
    color: var(--text-secondary);
    font-size: 14.5px;
    margin-bottom: 22px;
}

/* 技术关键词标签 */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tags span {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background-color: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border-color);
}

/* 可跳转卡片：a 元素作为网格子项需块级显示，继承卡片样式 */
a.tech-card {
    display: block;
}

/* 项目官网跳转提示：带箭头的引导文案 */
.tech-link {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-cyan);
}

/* 项目网址文本：次级色调 + 等宽字体，与引导文案区分层次 */
.tech-link-url {
    font-weight: 400;
    font-family: "SF Mono", Consolas, "Courier New", monospace;
    color: var(--text-secondary);
}

/* 悬停时箭头右移，增强可点击的视觉暗示 */
.tech-card-link:hover .tech-link-arrow {
    transform: translateX(4px);
}

.tech-link-arrow {
    transition: transform var(--transition);
}

/* ==================== 8. 公司优势 ==================== */
.advantage-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.advantage-item {
    position: relative;
    padding: 36px 26px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition);
}

.advantage-item:hover {
    transform: translateY(-6px);
    border-color: rgba(167, 139, 250, 0.45);
}

/* 序号水印：大字号半透明渐变数字 */
.advantage-num {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 18px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.9;
}

.advantage-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.advantage-desc {
    color: var(--text-secondary);
    font-size: 13.5px;
}

/* ==================== 9. 联系我们 ==================== */
/* 联系方式容器：单卡片居中展示 */
.contact-wrap {
    display: flex;
    justify-content: center;
}

/* QQ 联系方式卡片：加宽并居中内容，突出号码 */
.contact-wrap .contact-item {
    min-width: 360px;
    justify-content: center;
    align-items: center;
    padding: 32px 44px;
}

/* QQ 号码使用主文字色并加大字号，视觉上更醒目 */
.contact-wrap .contact-item p {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.contact-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
}

.contact-icon svg {
    width: 22px;
    height: 22px;
}

.contact-item h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.contact-item p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== 10. 页脚 ==================== */
.footer {
    padding: 48px 0 28px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.footer-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.footer-logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 3px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-slogan {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-top: 6px;
}

.footer-nav {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color var(--transition);
}

.footer-nav a:hover {
    color: var(--accent-cyan);
}

/* 版权区：顶部分隔线 */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
}

/* ==================== 11. 返回顶部按钮 ==================== */
.back-to-top {
    position: fixed;
    right: 28px;
    bottom: 32px;
    z-index: 900;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--text-primary);
    background-color: rgba(17, 24, 39, 0.9);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    /* 默认隐藏：透明度为 0 且禁用点击 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity var(--transition), transform var(--transition),
        visibility var(--transition), border-color var(--transition);
}

/* 显示态：由 JS 在滚动超过一屏后添加 .show 类 */
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* ==================== 12. 响应式适配 ==================== */

/* 平板端：768px - 1023px */
@media (max-width: 1023px) {
    .hero-title {
        font-size: 44px;
    }

    .section {
        padding: 80px 0;
    }

    .section-title {
        font-size: 30px;
    }

    /* 关于我们改为上下堆叠 */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* 技术卡片改为两列 */
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 优势改为两列 */
    .advantage-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机端：< 768px */
@media (max-width: 767px) {
    :root {
        --navbar-height: 60px;
    }

    .container {
        padding: 0 18px;
    }

    .section {
        padding: 64px 0;
    }

    .section-header {
        margin-bottom: 44px;
    }

    .section-title {
        font-size: 26px;
    }

    /* --- 移动端导航：折叠为抽屉式菜单 --- */
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 18px 20px;
        background-color: rgba(10, 14, 26, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--border-color);
        /* 默认收起：向上位移并隐藏 */
        transform: translateY(-130%);
        transition: transform 0.35s ease;
    }

    .nav-menu.open {
        transform: translateY(0);
    }

    .nav-link {
        padding: 13px 8px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    /* 隐藏桌面端的激活下划线，改用文字高亮 */
    .nav-link.active::after {
        display: none;
    }

    .nav-link.active {
        color: var(--accent-cyan);
    }

    /* --- Hero 区缩小字号 --- */
    .hero-title {
        font-size: 32px;
        letter-spacing: 2px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .hero-actions .btn {
        padding: 11px 26px;
        font-size: 14px;
    }

    /* --- 统计与卡片单列化 --- */
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    /* 3 张卡片在手机端为 2 列时，最后一张独占整行避免空缺 */
    .about-stats .stat-card:last-child {
        grid-column: 1 / -1;
    }

    .stat-card {
        padding: 22px 14px;
    }

    .stat-number {
        font-size: 30px;
    }

    .tech-grid,
    .advantage-grid {
        grid-template-columns: 1fr;
    }

    .tech-card {
        padding: 30px 24px;
    }

    /* 联系方式卡片在手机端占满宽度，避免横向溢出 */
    .contact-wrap .contact-item {
        min-width: 0;
        width: 100%;
        padding: 26px 20px;
    }

    /* --- 页脚纵向排列 --- */
    .footer-main,
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .back-to-top {
        right: 18px;
        bottom: 22px;
    }
}

/* 用户偏好减弱动效时：关闭所有动画，兼顾无障碍体验 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
