/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00d4ff;
    --primary-dark: #0099cc;
    --secondary-color: #7c3aed;
    --accent-color: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.6);
    --border-color: rgba(148, 163, 184, 0.1);
    --glow-color: rgba(0, 212, 255, 0.3);
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
}

/* 动态背景 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(245, 158, 11, 0.08) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-5%, -5%) rotate(5deg); }
    66% { transform: translate(5%, 5%) rotate(-5deg); }
}

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

/* 导航栏 - 玻璃态设计 */
.navbar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    letter-spacing: -0.5px;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: 2px;
}

.lang-switch {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-switch:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--glow-color);
    transform: translateY(-2px);
}

.lang-option {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.lang-option.active {
    color: var(--primary-color);
    font-weight: 600;
    text-shadow: 0 0 10px var(--glow-color);
}

.lang-divider {
    color: var(--border-color);
}

/* 头部 - 科技感渐变 */
.hero {
    text-align: center;
    padding: 6rem 0 5rem;
    background: linear-gradient(135deg, 
        rgba(124, 58, 237, 0.2) 0%, 
        rgba(0, 212, 255, 0.2) 50%,
        rgba(245, 158, 11, 0.2) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(0, 212, 255, 0.1) 50%, transparent 70%);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease;
    position: relative;
    z-index: 1;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 1s ease;
    position: relative;
    z-index: 1;
}

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

/* 项目展示 */
.projects {
    padding: 5rem 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

/* 项目卡片 - 玻璃态 + 发光效果 */
.project-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.4),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 212, 255, 0.1), 
        transparent);
    transition: left 0.5s ease;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 
        0 20px 60px 0 rgba(0, 0, 0, 0.5),
        0 0 40px var(--glow-color),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.1);
}

.project-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px var(--glow-color));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.project-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.project-subtitle {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px var(--glow-color);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.8;
    font-size: 1.05rem;
}

.project-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.feature-tag {
    display: inline-block;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.feature-tag:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--glow-color);
    transform: translateY(-2px);
}

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-weight: 600;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.project-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.project-link:hover::before {
    width: 300px;
    height: 300px;
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.6);
}

/* 页脚 */
.footer {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 0;
    margin-top: 5rem;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--primary-color), 
        transparent);
}

.footer-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

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

    .project-card {
        padding: 2rem;
    }

    .project-icon {
        font-size: 3rem;
    }

    .project-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 4rem 0 3rem;
    }

    .hero-title {
        font-size: 2rem;
    }

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

    .logo {
        font-size: 1.25rem;
    }

    .project-card {
        padding: 1.5rem;
    }

    .project-link {
        padding: 0.875rem 1.5rem;
    }
}

/* 导航栏头像 */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 15px var(--glow-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px var(--glow-color);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 浮动名片 */
.floating-card {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: floatingMove 20s ease-in-out infinite;
}

@keyframes floatingMove {
    0%, 100% { 
        transform: translate(0, 0);
    }
    25% { 
        transform: translate(-40px, -60px);
    }
    50% { 
        transform: translate(30px, -40px);
    }
    75% { 
        transform: translate(-30px, -80px);
    }
}

/* 移动端精确计算边界 */
@media (max-width: 768px) {
    .floating-card {
        /* 头像80px + 最大右移30px + 安全边距20px = 130px */
        bottom: 20px;
        right: 20px;
        /* 限制移动范围，确保不超出屏幕 */
        animation: floatingMoveMobile 20s ease-in-out infinite;
    }
    
    @keyframes floatingMoveMobile {
        0%, 100% { 
            transform: translate(0, 0);
        }
        25% { 
            /* 头像60px + 左移30px + 安全边距20px = 110px */
            transform: translate(-30px, -50px);
        }
        50% { 
            /* 头像60px + 右移20px + 安全边距20px = 100px */
            transform: translate(20px, -30px);
        }
        75% { 
            /* 头像60px + 左移25px + 安全边距20px = 105px */
            transform: translate(-25px, -60px);
        }
    }
}

.floating-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 30px var(--glow-color);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: floatingPulse 3s ease-in-out infinite;
}

@keyframes floatingPulse {
    0%, 100% { 
        box-shadow: 
            0 4px 20px rgba(0, 0, 0, 0.3),
            0 0 30px var(--glow-color);
    }
    50% { 
        box-shadow: 
            0 6px 30px rgba(0, 0, 0, 0.4),
            0 0 40px var(--glow-color);
    }
}

.floating-avatar:hover {
    transform: scale(1.1);
    box-shadow: 
        0 8px 40px rgba(0, 0, 0, 0.5),
        0 0 50px var(--glow-color);
}

.floating-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floating-info {
    position: absolute;
    bottom: 90px;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    min-width: 200px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 40px var(--glow-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.floating-card:hover .floating-info {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-name {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.floating-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.floating-social {
    display: flex;
    gap: 0.75rem;
}

.floating-social a {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.floating-social a:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 0 15px var(--glow-color);
}

/* 响应式 - 移动端调整浮动名片 */
@media (max-width: 768px) {
    .floating-avatar {
        width: 60px;
        height: 60px;
    }
    
    .floating-info {
        bottom: 70px;
        min-width: 180px;
        padding: 1.25rem;
    }
    
    .nav-avatar {
        width: 36px;
        height: 36px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--secondary-color), var(--primary-color));
}