/* ==========================================================
   0. 设计变量与通用样式 - 科技蓝冷色调
   定义颜色、尺寸、动画等基础变量，便于全局维护和主题切换。
   ========================================================== */
:root {
    --primary: #3498db; /* 主色调 - 科技蓝 */
    --secondary: #2ecc71; /* 辅色调 - 活力绿 */
    --text-dark: #2c3e50; /* 深色文本 - 深蓝灰 */
    --text-med: #34495e; /* 中色文本 - 蓝灰 */
    --text-light: #7f8c8d; /* 浅色文本 - 灰 */
    --bg-start: #f8f9fa; /* 背景起始色 - 浅灰 */
    --bg-end: #ecf0f1; /* 背景结束色 - 浅蓝灰 */
    --max-width: 1200px;
    --radius: 20px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    --transition: 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 重置默认样式，设置盒模型 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 设置页面滚动行为为平滑 */
html {
    scroll-behavior: smooth;
}

/* 全局字体、背景、文字颜色和行高设置 */
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 重置链接默认样式 */
a {
    text-decoration: none;
    color: inherit;
}

/* 背景纹理与网格 */
body::before, body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}
body::before {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0,50 Q25,40 50,50 T100,50 L100,100 L0,100 Z" fill="rgba(52,152,219,.03)"/></svg>');
    background-size: 200px;
    opacity: 0.5;
}
body::after {
    background-image: linear-gradient(rgba(52,152,219, 0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(52,152,219, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ==========================================================
   1. 导航栏 - 科技感设计
   ========================================================== */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1rem 5%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.6s var(--transition);
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2980b9;
    letter-spacing: .5px;
    transition: var(--transition);
}
.logo:hover { color: var(--primary); transform: scale(1.03); }

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}
.nav-links a {
    font-weight: 500;
    color: var(--text-med);
    padding: .5rem 0;
    position: relative;
    transition: var(--transition);
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 1px;
    transition: width var(--transition);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }

/* 移动端菜单按钮样式 */
.hamburger {
    display: none; /* 默认隐藏，仅在移动端显示 */
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 2000;
}
.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: 0.3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ==========================================================
   2. Hero 区域 - 科技蓝主题
   ========================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
    margin-top: 80px; /* 为固定导航栏留出空间 */
    position: relative;
}
.hero h1 {
    white-space: nowrap;
    overflow: visible;
    font-size: clamp(2rem, 5vw, 3.5rem);
}
.hero-content {
    max-width: 800px;
    text-align: center;
    animation: fadeInUp 1.2s var(--transition);
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    animation: typeWriter 2.5s var(--transition) both;
}
@keyframes typeWriter {
    0% { width: 0; opacity: 0; }
    1% { opacity: 1; }
    100% { width: 100%; opacity: 1; }
}
.hero p {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    animation: fadeInUp 1.2s var(--transition) .5s both;
}
.cta-button {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.3);
    transition: var(--transition);
    animation: fadeInUp 1.2s var(--transition) .8s both;
}
.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(52, 152, 219, 0.4);
}

/* 浮动装饰 */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 8s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}
.shape1 { top: 15%; left: 5%; width: 120px; height: 120px; background: linear-gradient(135deg, var(--primary), var(--secondary)); animation-delay: 0s; }
.shape2 { top: 65%; right: 8%; width: 80px; height: 80px; background: linear-gradient(135deg, var(--secondary), var(--primary)); animation-delay: 3s; }
.shape3 { bottom: 15%; left: 20%; width: 60px; height: 60px; background: linear-gradient(135deg, var(--primary), var(--secondary)); animation-delay: 6s; }

/* ==========================================================
   3. 关于我们 - 科技蓝主题
   ========================================================== */
.about {
    padding: 6rem 5%;
    position: relative;
    overflow: hidden;
}
.about::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(52, 152, 219, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 20% 80%, rgba(46, 204, 113, 0.1) 0%, transparent 40%);
    pointer-events: none;
}
.about-container {
    max-width: var(--max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.about h2 {
    text-align: center;
    font-size: 2.8rem;
    color: var(--text-dark);
    margin-bottom: 3rem;
}
.about h2::after {
    content: '';
    display: block;
    width: 80px; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    margin: 1rem auto 0;
}
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}
.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-med);
    line-height: 1.8;
    font-size: 1.1rem;
}
.about-text .lead {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2rem;
}
.about-text .highlight {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(46, 204, 113, 0.1));
    padding: 1.5rem;
    border-left: 4px solid var(--primary);
    border-radius: 15px;
    font-weight: 500;
}
.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow);
}
.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}
.stat-item:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); }
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: .5rem;
}
.stat-label { font-size: 1rem; color: var(--text-med); font-weight: 500; }

/* ==========================================================
   4. 服务项目 - 科技蓝主题
   ========================================================== */
.services {
    padding: 6rem 5%;
    position: relative;
    overflow: hidden;
}
.services::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(46, 204, 113, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(52, 152, 219, 0.1) 0%, transparent 40%);
    pointer-events: none;
}
.services-container {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}
.services h2 {
    display: inline-block;
    font-size: 2.8rem;
    color: var(--text-dark);
    margin-bottom: 4rem;
    position: relative;
    padding: 0 2rem;
}
.services h2::after {
    content: '';
    position: absolute;
    bottom: -15px; left: 50%;
    transform: translateX(-50%);
    width: 80px; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    max-width: var(--max-width);
    margin: 0 auto;
}
.service-card {
    background: rgba(255, 255, 255, 0.7);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all .5s var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .5s var(--transition);
}
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.85);
}
.service-card:hover::before { transform: scaleX(1); }
.service-icon {
    width: 70px; height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem; color: #fff;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}
.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4);
}
.service-card h3 { font-size: 1.5rem; color: var(--text-dark); margin-bottom: 1.2rem; font-weight: 600; }
.service-card p { color: var(--text-light); line-height: 1.7; }

/* ==========================================================
   5. 页脚 - 科技蓝主题
   ========================================================== */
footer {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: var(--bg-end);
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}
footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 10% 20%, rgba(52, 152, 219, 0.1) 0%, transparent 30%),
                radial-gradient(circle at 90% 80%, rgba(46, 204, 113, 0.1) 0%, transparent 30%);
    pointer-events: none;
}
.contact-info { margin-bottom: 2rem; position: relative; z-index: 1; }
.contact-info p {
    margin: .8rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
}
.social-links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}
.social-links a {
    width: 50px; height: 50px;
    font-size: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}
.social-links a:hover {
    transform: translateY(-5px);
    color: var(--primary);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ==========================================================
   6. 滚动动画通用类
   ========================================================== */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s var(--transition);
}
.scroll-animate.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================
   7. 响应式微调
   ========================================================== */
@media (max-width: 768px) {
    /* 隐藏桌面版导航链接，显示汉堡按钮 */
    .nav-links {
        position: fixed;
        inset: 0 0 0 40%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform .35s var(--transition);
        box-shadow: -8px 0 20px rgba(0, 0, 0, 0.05);
        list-style: none;
    }
    .nav-links.open {
        transform: translateX(0);
    }
    .hamburger {
        display: flex;
    }

    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.1rem; }
    .service-grid { grid-template-columns: 1fr; }
    .about-content { grid-template-columns: 1fr; gap: 2rem; }
    .about-stats { grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem; }
    .stat-number { font-size: 2rem; }
    .about h2, .services h2 { font-size: 2.3rem; }
}

@media (max-width: 480px) {
    .about-stats { grid-template-columns: 1fr; }
}

/* ================= 手机端 UI 美化补丁 ================= */
@media (max-width: 768px) {
    /* 0. 变量 - 降低饱和度 & 圆角统一 */
    :root {
        --radius: 24px;
        --shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
        --safe-bottom: env(safe-area-inset-bottom, 20px); /* 适配 Home Bar */
    }
    /* 1. 导航栏 - 玻璃态 + 下沉阴影 */
    nav {
        background: rgba(255, 255, 255, 0.82);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.6);
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
        padding: .75rem 5% calc(.75rem + var(--safe-bottom));
    }
    .logo {
        font-size: 1.5rem;
    }
    /* 2. Hero - 沉浸全屏 & 文字节奏 */
    .hero {
        min-height: 100vh;
        margin-top: 0;
        padding: 25vh 5% 15vh;
        text-align: center;
    }
    .hero h1 {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
        white-space: nowrap;
        overflow: visible;
        line-height: 1.2;
    }
    .hero p {
        font-size: 1.1rem;
        margin: 1rem auto 2rem;
        max-width: 90%;
    }
    .cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
        border-radius: 50px;
        min-width: 200px;
    }
    /* 3. 关于我们 - 卡片呼吸 + 数字动画 */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .about-text p {
        font-size: 1rem;
    }
    .about-stats {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: 1.5rem;
        border-radius: var(--radius);
    }
    .stat-item {
        border-radius: 16px;
        padding: 1.2rem .5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }
    .stat-number {
        font-size: 2rem;
    }
    /* 4. 服务卡片 - 横向滑感 & 大图 icon */
    .service-grid {
        grid-auto-flow: column;
        grid-template-columns: 80vw; /* 一卡一屏 */
        gap: 1.2rem;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 0 1rem 2rem;
        -webkit-overflow-scrolling: touch;
    }
    .service-card {
        scroll-snap-align: start;
        padding: 2rem 1.5rem;
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
    /* 隐藏横向滚动条 */
    .service-grid::-webkit-scrollbar {
        display: none;
    }
    /* 5. 页脚 - 加高触控 & 安全区 */
    footer {
        padding: 2.5rem 1rem calc(2.5rem + var(--safe-bottom));
    }
    .contact-info p {
        font-size: 1rem;
        justify-content: flex-start;
        gap: .6rem;
    }
    .social-links a {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
    /* 6. 全局微交互 - 点击波纹 */
    .cta-button,
    .service-card,
    .stat-item,
    .social-links a {
        -webkit-tap-highlight-color: transparent;
        position: relative;
        overflow: hidden;
    }
    .cta-button::after,
    .service-card::after,
    .stat-item::after,
    .social-links a::after {
        content: '';
        position: absolute;
        inset: 50% 50% 50% 50%;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        transform: scale(0);
        opacity: 0;
        transition: .6s;
    }
    .cta-button:active::after,
    .service-card:active::after,
    .stat-item:active::after,
    .social-links a:active::after {
        transform: scale(4);
        opacity: 1;
        transition: 0s;
    }
}

/* ================= 手机端「我们的服务」美化 ================= */
@media (max-width: 768px) {
    /* 0. 重置：取消横向滑动，恢复单列 */
    .service-grid {
        grid-auto-flow: row;
        grid-template-columns: 1fr;
        overflow: visible;
        scroll-snap-type: none;
        padding: 0;
        gap: 1.2rem;
    }
    /* 1. 卡片：更圆润、更窄、居中呼吸 */
    .service-card {
        max-width: 320px;
        margin: 0 auto;
        padding: 1.8rem 1.5rem;
        border-radius: var(--radius);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
        transition: all .35s cubic-bezier(.23, 1, .32, 1);
    }
    .service-card:active {
        transform: scale(.97);
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    }
    /* 2. 图标：放大并加微动效 */
    .service-icon {
        width: 64px;
        height: 64px;
        font-size: 1.7rem;
        margin-bottom: 1.2rem;
        transition: .4s;
    }
    .service-card:hover .service-icon {
        transform: scale(1.12) rotate(8deg);
    }
    /* 3. 文字：缩小行高，加大标题 */
    .service-card h3 {
        font-size: 1.25rem;
        margin-bottom: .8rem;
    }
    .service-card p {
        font-size: .95rem;
        line-height: 1.6;
        color: var(--text-light);
    }
    /* 4. 顶部渐变指示条（替代原 hover 条） */
    .service-card::before {
        height: 4px;
        border-radius: 2px 2px 0 0;
        transform: scaleX(0);
    }
    .service-card:hover::before {
        transform: scaleX(1);
    }
    /* 5. 一屏最多两张卡片，避免拥挤 */
    .service-card:nth-child(n + 3) {
        margin-top: .8rem;
    }
    /* 6. 移除横向滚动条残留 */
    .service-grid::-webkit-scrollbar {
        display: none;
    }
}

/* Logo 图片样式 */
.logo-img {
    height: 50px; /* 固定高度，宽度按比例自适应 */
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}
.logo-img:hover {
    transform: scale(1.05);
}
