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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* 默认为暗黑模式 */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: rgba(99, 102, 241, 0.2);
    --card-bg: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: rgba(99, 102, 241, 0.2);
    --card-bg: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --border-color: rgba(99, 102, 241, 0.15);
    --card-bg: rgba(99, 102, 241, 0.03);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

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

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* 汉堡按钮动画 */
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #6366f1 1px, transparent 1px);
    background-size: 50px 50px;
    animation: drift 20s infinite linear;
}

@keyframes drift {
    from { transform: translate(0, 0); }
    to { transform: translate(50px, 50px); }
}

.hero-content {
    text-align: center;
    z-index: 1;
    padding: 2rem;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-subtitle {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--text-secondary);
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-color);
    animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease 0.6s both;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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


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

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.scroll-indicator span {
    width: 3px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}

/* Sections */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.about-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.about-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.about-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Skills Section */
.skills {
    background: var(--bg-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    padding: 2rem;
    width: calc(50% - 2rem);
    margin-bottom: 2rem;
}

.timeline-item:nth-child(odd) {
    margin-left: auto;
    text-align: left;
}

.timeline-item:nth-child(even) {
    text-align: right;
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    top: 2rem;
}

.timeline-item:nth-child(odd)::before {
    left: -2.5rem;
}

.timeline-item:nth-child(even)::before {
    right: -2.5rem;
}

.timeline-date {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.timeline-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-role {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
}

.timeline-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.timeline-content li::before {
    content: '▸ ';
    color: var(--primary-color);
}

/* Projects */
.projects {
    background: var(--bg-secondary);
}

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

.project-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.project-header h3 {
    color: var(--primary-color);
}

.project-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-tags span {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* Contact */
.contact-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--secondary-color);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-secondary);
}

/* 移动端菜单样式 */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-menu.mobile-menu {
    position: fixed;
    top: 80px;
    left: 1rem;
    right: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    z-index: 1000;
    flex-direction: column;
    padding: 1.5rem;
    gap: 0;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 300px;
    margin: 0 auto;
}

[data-theme="light"] .nav-menu.mobile-menu {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.nav-menu.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
}

.nav-menu.mobile-menu .nav-link {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0.25rem 0;
    padding: 0.75rem 1rem;
    position: relative;
    overflow: hidden;
}

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

.nav-menu.mobile-menu .nav-link:hover {
    background: var(--card-bg);
    color: var(--primary-color);
    transform: translateX(8px);
}

.nav-menu.mobile-menu .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-menu.mobile-menu .nav-link:hover::before {
    transform: scaleY(1);
}

/* 移动端菜单项的点击效果 */
.nav-menu.mobile-menu .nav-link:active {
    transform: translateX(8px) scale(0.98);
    background: var(--primary-color);
    color: white;
}

/* 移动端菜单的进入动画 */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-menu.mobile-menu.active {
    animation: slideInDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        width: calc(100% - 60px);
        margin-left: 60px;
        text-align: left;
    }
    
    .timeline-content {
        text-align: left;
    }
    
    .timeline-content h3,
    .timeline-content p,
    .timeline-content ul,
    .timeline-content li {
        text-align: left;
    }
    
    .timeline-item::before {
        left: -45px;
    }
    
    .contact-info {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

/* Theme and Language Toggle */
.theme-lang-toggle {
    position: fixed;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toggle-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: var(--bg-primary);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.toggle-btn:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    transform: scale(1.1);
}

.theme-toggle {
    font-family: Arial, sans-serif;
}

.lang-toggle {
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .theme-lang-toggle {
        right: 1rem;
        top: auto;
        bottom: 2rem;
        flex-direction: row;
        transform: none;
    }
    
    .toggle-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}
