:root {
    --primary-dark: #0a0a14;
    --primary-light: #1a1a2e;
    --accent: #e63946;
    --accent-light: #ff6b6b;
    --accent-dark: #c1121f;
    --text-light: #f8f9fa;
    --text-gray: #adb5bd;
    --white: #ffffff;
    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--primary-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    background: linear-gradient(135deg, #0a0a14 0%, #1a1a2e 100%);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 0;
    position: relative;
    top: 0;
}

/* 导航栏容器样式 */
#navbar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
}

body {
    padding-top: 0;
}

/* 移除导航栏占位 */
.nav-placeholder {
    display: none;
}

.nav-links li {
    margin: 0 15px;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

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

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover:after {
    width: 100%;
}

.cta-button {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 30px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.5px;
}

.cta-button:hover {
    background: rgba(230, 57, 70, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(230, 57, 70, 0.3);
}

/* Hero区域 */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(230,57,70,0.1) 0%, rgba(10,10,20,0) 70%);
    z-index: -1;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0.6;
    display: block;
}

/* 视频无法播放时的备选背景图样式 */
.hero-fallback-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    opacity: 0.15;
}

/* 移动设备和特定浏览器的兼容性备选背景 */
.hero-fallback-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    display: none;
}

.hero-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.15;
}

/* 媒体查询 - 针对移动设备和可能不支持视频自动播放的浏览器 */
@media (max-width: 768px) {
    .hero-video {
        display: none;
    }
    .hero-fallback-container {
        display: block;
    }
}

/* 增加360浏览器的特定处理 */
@media screen and (-webkit-min-device-pixel-ratio:0) and (max-width: 768px) {
    .hero-video {
        display: none !important;
    }
    .hero-fallback-container {
        display: block !important;
    }
}

.hero-content {
    max-width: 900px;
    padding: 0 1px;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    color: var(--accent);
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-title {
    font-size: 72px;
    margin-bottom: 25px;
    line-height: 1.1;
    background: linear-gradient(to right, #ffffff, #ffb6b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* text-fill-color: transparent; */
}

.hero-text {
    font-size: 20px;
    margin-bottom: 40px;
    color: var(--text-gray);
    max-width: 600px;
    font-weight: 300;
}

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

.primary-button {
    background: linear-gradient(45deg, var(--accent), var(--accent-dark));
    color: white;
    border: none;
    border-radius: 30px;
    padding: 16px 38px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 5px 15px rgba(230, 57, 70, 0.4);
    letter-spacing: 0.5px;
}

.primary-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(230, 57, 70, 0.6);
}

/* 作品展示区 */
.section-title {
    text-align: center;
    margin-top: 70px;
    margin-bottom: 20px;
    position: relative;
}

.section-title h2 {
    font-size: 42px;
    display: inline-block;
    position: relative;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 15px auto 0;
    border-radius: 2px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background: rgba(26, 26, 46, 0.7);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* 减轻阴影效果 */
    border: 1px solid rgba(230, 57, 70, 0.1);
    /* 移除backdrop-filter以提高性能 */
}

.project-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 15px 40px rgba(230, 57, 70, 0.25);
    border-color: rgba(230, 57, 70, 0.3);
}

.project-image {
    height: 250px;
    width: 100%;
    background: linear-gradient(45deg, #1a1a2e, #2a2a4e);
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-category {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 15px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(230, 57, 70, 0.3);
}

.project-content {
    padding: 10px;
}

.project-content h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: var(--text-light);
}

.project-content p {
    color: var(--text-gray);
    margin-bottom: 20px;
    font-size: 15px;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.project-link i {
    margin-left: 8px;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--accent-light);
}

.project-link:hover i {
    transform: translateX(5px);
}

/* 服务区域 */
.services {
    background: rgba(10, 10, 20, 0.7);
    position: relative;
    overflow: hidden;
}

.services::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230,57,70,0.15) 0%, rgba(10,10,20,0) 70%);
    z-index: 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: rgba(26, 26, 46, 0.7);
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(230, 57, 70, 0.1);
    position: relative;
    z-index: 1;
}

.service-card:hover {
    transform: translateY(-10px);
    background: rgba(26, 26, 46, 0.9);
    border-color: rgba(230, 57, 70, 0.3);
    box-shadow: 0 15px 30px rgba(230, 57, 70, 0.2);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: rgba(230, 57, 70, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 32px;
    color: var(--accent);
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: rgba(230, 57, 70, 0.2);
    transform: scale(1.1);
}

/* 服务图片样式 */
.service-image {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.service-card:hover .service-image {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(230, 57, 70, 0.3);
}

.service-card:hover .service-image img {
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--text-light);
}

.service-card p {
    color: var(--text-gray);
    font-size: 15px;
}

.service-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

.service-card-link:hover {
    transform: translateY(-5px);
}

/* 关于我们区域 */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin-top: 70px;
}

.about-image {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    height: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(230, 57, 70, 0.2);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.about-image:hover img {
    transform: scale(1.03);
}

.about-text h2 {
    font-size: 42px;
    margin-bottom: 25px;
    color: var(--text-light);
}

.about-text p {
    color: var(--text-gray);
    margin-bottom: 25px;
    font-size: 17px;
}

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

.stat-item {
    text-align: center;
    background: rgba(26, 26, 46, 0.7);
    padding: 20px;
    border-radius: 10px;
    transition: var(--transition);
    border: 1px solid rgba(230, 57, 70, 0.1);
}

.stat-item:hover {
    transform: translateY(-5px);
    border-color: rgba(230, 57, 70, 0.3);
}

.stat-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-gray);
    font-size: 16px;
}

/* 页脚 */
footer {
    background: #050510;
    padding: 100px 0 30px;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

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

.footer-column h3 {
    font-size: 20px;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
    color: var(--text-light);
}

.footer-column h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--accent);
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(173, 181, 189, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(230, 57, 70, 0.3);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(136, 146, 176, 0.1);
    color: var(--text-gray);
    font-size: 14px;
}

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

@media (max-width: 992px) {
    .hero-title {
        font-size: 48px;
    }
    .about-content {
        grid-template-columns: 1fr;
    }
    .about-image {
        height: 400px;
    }
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }
    .hero-title {
        font-size: 38px;
    }
    .hero-text {
        font-size: 18px;
    }
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .section-title h2 {
        font-size: 36px;
    }
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    .stats {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 32px;
    }
}

/* 优化后的动画效果 - 仅在视口内显示时激活 */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* 默认不播放动画 */
.floating {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* 元素进入视口时触发的动画类 */
.floating.animate {
    opacity: 1;
    transform: translateY(0);
    animation: float 6s ease-in-out infinite;
}

/* 粒子背景 */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

/* 文字截断样式 */
.project-content p {
    display: -webkit-box;
    display: -moz-box;
    display: box;
    -webkit-line-clamp: 2;
    -moz-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    max-height: 3em; /* 大约两行文字的高度 */
    transition: max-height 0.3s ease;
}

.project-content p.expanded {
    display: block;
    -webkit-line-clamp: unset;
    -moz-line-clamp: unset;
    line-clamp: unset;
    -webkit-box-orient: unset;
    -moz-box-orient: unset;
    box-orient: unset;
    overflow: visible;
    max-height: none;
}

/* 展开按钮样式 */
.project-link {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.project-link.expanded i {
    transform: rotate(180deg);
}

/* 招聘信息链接样式 */
.jobs-link {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid rgba(230, 57, 70, 0.3);
}

.jobs-link:hover {
    background: rgba(230, 57, 70, 0.2);
    color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}