/* Global Styles & Variables */
:root {
    --bg-color: #ffffff;
    --bg-alt: #f5f7fa;
    --primary: #0066ff; /* 阿里/腾讯蓝 */
    --primary-dark: #0052cc;
    --text-main: #1d1d1f; /* 苹果黑 */
    --text-muted: #86868b;
    --border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    --font-main: 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --container-width: 1280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* 保持自定义光标 */
}

html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* 自定义光标 (适配浅色) */
.cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 10px; height: 10px;
    background-color: var(--primary);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.cursor-outline {
    position: fixed;
    top: 0; left: 0;
    width: 40px; height: 40px;
    border: 1px solid rgba(0, 102, 255, 0.3);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* ... Global Styles ... */


/* 导航栏 - 悬浮灵动岛风格 */
header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px; /* 紧凑内边距 */
    z-index: 100;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.02), 
        0 10px 15px -3px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 滚动时的状态：稍微变窄，背景变实 */
header.scrolled {
    top: 10px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    width: 95%; /* 稍微变宽 */
    max-width: 1280px;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
    padding-left: 15px;
}

.logo-img {
    height: 62px;
    width: auto;
    transition: height 0.3s;
}
header.scrolled .logo-img { height: 28px; }

.nav-links {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.04); /* 浅灰色槽 */
    padding: 4px;
    border-radius: 40px;
    margin: 0 20px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 24px;
    border-radius: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 胶囊 Hover 效果 */
.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

a{
    text-decoration: none;
}

.nav-link::after { display: none; } /* 移除旧下划线 */

.nav-btn {
    padding: 10px 28px;
    background: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-right: 5px;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.4);
}

/* Language Switcher */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-left: 10px;
    font-weight: 600;
}

.lang-btn {
    cursor: pointer;
    transition: color 0.3s;
    padding: 2px 4px;
}

.lang-btn:hover, .lang-btn.active {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        top: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        padding: 0 20px;
        background: rgba(255,255,255,0.95);
    }
    .nav-links { display: none; }
    .nav-btn { display: none; }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    padding-top: 140px; /* 增加顶部内边距，适配悬浮导航 */
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: transparent; /* 关键修改：改为透明，让背景透出来 */
}

/* 动态流体背景层 */
.animated-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -2;
    overflow: hidden;
    background: #ffffff;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: move 25s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: rgba(0, 102, 255, 0.2); /* 科技蓝 */
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: rgba(0, 200, 255, 0.15); /* 青色 */
    animation-delay: -5s;
}

.blob-3 {
    bottom: 20%;
    left: 20%;
    width: 30vw;
    height: 30vw;
    background: rgba(100, 100, 255, 0.1); /* 紫色点缀 */
    animation-delay: -10s;
}

@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

/* Canvas 粒子层 (叠加在流体之上) */
#canvas-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    opacity: 0.8; /* 稍微调高不透明度 */
}

/* ... Hero Grid ... */

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

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

.hero-text h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text-main);
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 500px;
}

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

.btn-primary {
    padding: 16px 40px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(0, 102, 255, 0.2);
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 102, 255, 0.3);
}

.btn-secondary {
    padding: 16px 40px;
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}
.btn-secondary:hover {
    border-color: var(--text-main);
}

/* Hero Image Animation */
.hero-img-wrapper {
    position: relative;
    perspective: 1000px;
}

.hero-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    transform: rotateY(-5deg) rotateX(5deg);
    transition: transform 0.1s; /* JS控制平滑度 */
    background: #fff;
    padding: 10px;
}

/* floating badge */
.hero-badge {
    position: absolute;
    bottom: -20px; left: -20px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.badge-icon {
    width: 50px; height: 50px;
    background: rgba(0, 102, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.5rem;
}

/* Sections */
.section { padding: 120px 0; }
.section-header {
    text-align: center;
    margin-bottom: 80px;
}
.section-tag {
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.875rem;
    margin-bottom: 16px;
    display: block;
}
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}
.section-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Portfolio (Cards) */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 改为3列展示更多案例 */
    gap: 30px;
}

.project-card {
    background: #fff;
    border-radius: 12px; /* 圆角稍小一点，显得更商务 */
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

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

.project-img {
    height: 240px; /* 高度适配3列 */
    overflow: hidden;
    position: relative;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
    cursor: zoom-in; /* 提示可点击放大 */
}

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

.project-info {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
}

.project-client {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-client::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

/* Responsive Portfolio */
@media (max-width: 1024px) {
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .portfolio-grid { grid-template-columns: 1fr; }
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.project-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    group: hover;
    cursor: pointer;
    border: 1px solid var(--border);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.project-img {
    height: 360px;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

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

.project-info { padding: 32px; }
.project-tags {
    display: flex; gap: 10px; margin-bottom: 16px;
}
.tag {
    font-size: 0.75rem;
    padding: 6px 12px;
    background: var(--bg-alt);
    color: var(--text-muted);
    border-radius: 20px;
    font-weight: 600;
}
.project-title { font-size: 1.5rem; margin-bottom: 10px; font-weight: 700; }
.project-desc { color: var(--text-muted); }

/* Services (Icons) */
.services-section { background: var(--bg-alt); }
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}
.service-item {
    background: #fff;
    padding: 40px 30px;
    border-radius: 12px;
    transition: all 0.3s;
    border: 1px solid transparent;
}
.service-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}
.service-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 24px;
}
.service-item h3 { font-size: 1.25rem; margin-bottom: 12px; }
.service-item p { font-size: 0.9rem; color: var(--text-muted); }

/* About Section (New) */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    margin-bottom: 80px;
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: justify;
}

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

.stat-card {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.3s;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-sm); }
.stat-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
}
.stat-label { color: var(--text-muted); font-size: 0.9rem; }

/* Timeline */
.timeline {
    position: relative;
    padding: 40px 0;
    margin-top: 60px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
    transform: translateX(-50%);
}
.timeline-item {
    display: flex;
    justify-content: flex-end;
    padding-right: 50px;
    position: relative;
    margin-bottom: 40px;
    width: 50%;
}
.timeline-item:nth-child(even) {
    align-self: flex-end;
    justify-content: flex-start;
    padding-right: 0;
    padding-left: 50px;
    margin-left: 50%;
}
.timeline-dot {
    position: absolute;
    right: -6px; top: 0;
    width: 14px; height: 14px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item:nth-child(even) .timeline-dot { right: auto; left: -6px; }

.timeline-date {
    font-family: var(--font-mono);
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}
.timeline-content h4 { font-size: 1.2rem; margin-bottom: 8px; font-weight: 700; }
.timeline-content p { color: var(--text-muted); font-size: 0.9rem; }

/* Jump Game UI */
.game-section {
    background: #f0f2f5; /* 浅色背景适配跳一跳风格 */
    color: var(--text-main);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
    text-align: center;
    user-select: none;
}
.game-wrapper {
    position: relative;
    height: 500px;
    background: linear-gradient(to bottom, #e0e7ff, #ffffff); /* 蓝白渐变天空 */
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}
#game-canvas { width: 100%; height: 100%; cursor: pointer; }
.game-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    padding: 40px;
    border-radius: 16px;
    width: 400px;
    box-shadow: var(--shadow-lg);
}
.game-overlay h3{
    color: #000000!important;
}
.score-board {
    position: absolute;
    top: 30px; left: 30px;
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.3;
    font-family: var(--font-mono);
    pointer-events: none;
}
.power-bar-container {
    position: absolute;
    bottom: 30px; left: 50%;
    transform: translateX(-50%);
    width: 200px; height: 6px;
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s;
}
.power-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s linear; /* 线性增长 */
}

/* Contact Details */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-top: 60px;
    text-align: left;
}
.contact-item {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
}
.contact-item h4 { font-size: 1.1rem; margin-bottom: 15px; color: #fff; opacity: 0.9; }
.contact-item p { color: rgba(255,255,255,0.7); font-size: 0.95rem; margin-bottom: 5px; }
.contact-item i { color: #fff; margin-right: 10px; }

/* Responsive Timeline */
@media (max-width: 768px) {
    .timeline::before { left: 20px; }
    .timeline-item { width: 100%; padding-left: 50px; padding-right: 0; text-align: left; align-self: flex-start; margin-left: 0; }
    .timeline-item:nth-child(even) { padding-left: 50px; }
    .timeline-dot { left: 13px; right: auto; }
    .timeline-item:nth-child(even) .timeline-dot { left: 13px; }
    .about-grid, .about-stats, .contact-grid { grid-template-columns: 1fr; }
    .timeline{overflow: hidden; max-width: 100%}
    .timeline-item:nth-child(even) {margin-left: 0; padding-left: 90px}

}
.game-section {
    background: #111; /* 保持深色以区分区域 */
    color: #fff;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.game-wrapper {
    position: relative;
    height: 500px;
    background: #000;
    border-radius: 16px;
    border: 1px solid #333;
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
}
#game-canvas { width: 100%; height: 100%; cursor: crosshair; }
.game-ui {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}
.game-btn {
    padding: 15px 40px;
    background: var(--primary);
    color: #fff;
    font-family: var(--font-mono);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

/* Contact Footer */
.footer-contact {
    background: var(--primary);
    color: #fff;
    padding: 100px 0;
    text-align: center;
}
.footer-contact h2 { font-size: 3rem; margin-bottom: 30px; }
.contact-btn {
    background: #fff;
    color: var(--primary);
    padding: 18px 50px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    display: inline-block;
    transition: transform 0.2s;
}
.contact-btn:hover { transform: scale(1.05); }

/* Responsive */
@media (max-width: 992px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-btns { justify-content: center; }
    .hero-badge { display: none; }
    .portfolio-grid, .services-grid { grid-template-columns: 1fr; }
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.image-modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

#modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
    font-size: 1.2rem;
    margin-top: 20px;
}

.image-modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10001;
}

.image-modal-close:hover,
.image-modal-close:focus {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoomIn {
    from {transform:scale(0.9); opacity: 0;}
    to {transform:scale(1); opacity: 1;}
}

@media only screen and (max-width: 700px){
    .image-modal-content {
        width: 100%;
    }
}