/* ===========================
   全局样式
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --text-color: #334155;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
    /* 防止移动端双击缩放 */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    /* 优化移动端滚动 */
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 移动端优化 container */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 20px auto 0;
}

/* ===========================
   导航栏
   =========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 10px 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    gap: 10px;
}

.logo i {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    /* 优化移动端触摸 */
    -webkit-tap-highlight-color: transparent;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: var(--transition);
}

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    transition: var(--transition);
}

/* ===========================
   英雄区
   =========================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    border: 2px solid transparent;
    /* 优化移动端触摸 */
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    user-select: none;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 1s ease-in;
}

.fade-in-delay-1 {
    animation: fadeIn 1s ease-in 0.3s both;
}

.fade-in-delay-2 {
    animation: fadeIn 1s ease-in 0.6s both;
}

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

/* ===========================
   关于我们
   =========================== */
.about {
    background-color: var(--light-color);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image .image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.about-image i {
    font-size: 8rem;
    color: white;
    opacity: 0.8;
}

.about-text h3 {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 30px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
}

.stat-item h4 {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ===========================
   服务
   =========================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.services-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.service-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: var(--gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: rotateY(360deg);
}

.service-icon i {
    font-size: 2.5rem;
    color: white;
}

.service-card h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-light);
    line-height: 1.6;
}

/* ===========================
   案例展示
   =========================== */
.portfolio {
    background: var(--light-color);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.portfolio-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 5个产品时的特殊布局优化 */
.portfolio-grid-3 .portfolio-item:nth-child(4),
.portfolio-grid-3 .portfolio-item:nth-child(5) {
    /* 第二行的2个产品保持正常显示 */
}

.portfolio-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.portfolio-image .image-placeholder {
    width: 100%;
    height: 300px;
    background: var(--gradient-3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-image i {
    font-size: 5rem;
    color: white;
    opacity: 0.8;
}

.portfolio-content {
    padding: 30px;
}

.portfolio-content h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.portfolio-content p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.portfolio-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.portfolio-link:hover,
.portfolio-link:active {
    gap: 10px;
}

/* ===========================
   团队
   =========================== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.team-member {
    text-align: center;
    transition: var(--transition);
}

.team-member:hover {
    transform: translateY(-10px);
}

.member-image .image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--gradient-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.member-image i {
    font-size: 5rem;
    color: white;
    opacity: 0.8;
}

.team-member h3 {
    font-size: 1.3rem;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.member-role {
    color: var(--text-light);
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.social-links a:hover,
.social-links a:active {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* ===========================
   联系我们
   =========================== */
.contact {
    background: var(--light-color);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
}

.info-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.info-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon i {
    font-size: 1.5rem;
    color: white;
}

.info-text h4 {
    color: var(--dark-color);
    margin-bottom: 5px;
}

.info-text p {
    color: var(--text-light);
}

.contact-form {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    /* 移动端优化 */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-block {
    width: 100%;
}

/* ===========================
   页脚
   =========================== */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a,
.footer-section ul li {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: white;
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.social-icons a:hover,
.social-icons a:active {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: white;
}

/* ===========================
   返回顶部按钮
   =========================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* ===========================
   响应式设计
   =========================== */
@media (max-width: 992px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

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

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

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

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

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

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

    .section-header {
        margin-bottom: 40px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        transition: var(--transition);
        gap: 0;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: 15px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .hamburger {
        display: flex;
        padding: 10px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    .hero {
        min-height: 100vh;
        padding: 80px 0 40px;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        font-size: 1.05rem;
        margin-bottom: 30px;
        line-height: 1.6;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .services-grid,
    .services-grid-3,
    .portfolio-grid,
    .portfolio-grid-3,
    .team-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-card,
    .portfolio-item {
        padding: 30px 20px;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-form {
        padding: 30px 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-item h4 {
        font-size: 2rem;
    }

    .about-content {
        gap: 40px;
    }

    .portfolio-image .image-placeholder {
        height: 200px;
    }

    .team-grid {
        gap: 30px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .btn {
        padding: 14px 25px;
        font-size: 0.95rem;
        width: 100%;
        text-align: center;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    .logo span {
        font-size: 1.2rem;
    }

    .service-card h3,
    .portfolio-content h3,
    .team-member h3 {
        font-size: 1.2rem;
    }

    .service-card p,
    .portfolio-content p {
        font-size: 0.9rem;
    }

    .about-text h3 {
        font-size: 1.5rem;
    }

    .about-text p {
        font-size: 0.95rem;
    }

    .stat-item h4 {
        font-size: 1.8rem;
    }

    .stat-item p {
        font-size: 0.85rem;
    }

    /* 增大触摸区域 */
    .nav-link {
        padding: 10px 0;
        display: block;
    }

    /* 优化表单在移动端的显示 */
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* 防止iOS自动缩放 */
    }

    /* 优化信息卡片 */
    .info-item {
        margin-bottom: 25px;
    }

    /* 页脚优化 */
    .footer {
        padding: 40px 0 15px;
    }

    .footer-section {
        margin-bottom: 25px;
    }

    .footer-section:last-child {
        margin-bottom: 0;
    }

    /* 社交图标 */
    .social-icons a,
    .social-links a {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    /* 服务卡片优化 */
    .service-icon {
        width: 70px;
        height: 70px;
    }

    .service-icon i {
        font-size: 2rem;
    }

    /* 团队成员卡片 */
    .member-image .image-placeholder {
        margin-bottom: 15px;
    }

    /* 导航栏优化 */
    .nav-wrapper {
        padding: 15px 0;
    }

    /* 滚动指示器 */
    .scroll-indicator {
        font-size: 1.5rem;
    }

    /* 确保容器在小屏幕上有足够间距 */
    .section {
        padding: 40px 0;
    }
}

