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

/* 根变量定义 - 浅色主题 */
:root {
    --primary-color: #018eee;
    --primary-dark: #0177cc;
    --primary-light: #33a3f0;
    --secondary-color: #f8f9fa;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #ffffff;
    --background-light: #ffffff;
    --background-gray: #f8f9fa;
    --border-color: #e9ecef;
    --shadow-light: 0 2px 10px rgba(1, 142, 238, 0.1);
    --shadow-medium: 0 4px 20px rgba(1, 142, 238, 0.15);
    --shadow-heavy: 0 8px 30px rgba(1, 142, 238, 0.2);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* 深色主题变量 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #e2e8f0;
        --text-secondary: #94a3b8;
        --text-light: #ffffff;
        --background-light: #1a202c;
        --background-gray: #2d3748;
        --border-color: #4a5568;
        --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.4);
        --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.5);
    }
}

/* 基础样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-light);
    overflow-x: hidden;
}

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

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

/* 深色主题下的导航栏 */
@media (prefers-color-scheme: dark) {
    .navbar {
        background: rgba(26, 32, 44, 0.95);
    }
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h2 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
    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: var(--transition);
}

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

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

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition);
}

/* 主页部分 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding-top: 70px;
}

/* 深色主题下的hero背景 */
@media (prefers-color-scheme: dark) {
    .hero {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    }
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    color: var(--primary-color);
    position: relative;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.hero-slogan {
    font-size: 1.4rem;
    color: #ff6b35;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-style: italic;
    text-shadow: 0 2px 4px rgba(255, 107, 53, 0.2);
    letter-spacing: 0.5px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-light);
    transform: translateY(-2px);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-heavy);
    transition: var(--transition);
    overflow: hidden;
    padding: 8px;
}

.avatar:hover {
    transform: scale(1.05);
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}

.avatar i {
    font-size: 6rem;
    color: var(--text-light);
}

/* 通用部分样式 */
section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
}

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

/* 关于部分 */
.about {
    background: var(--background-gray);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

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

.skills h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.skill-tag {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.skill-tag:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* 项目部分 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--background-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

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

.project-card.featured {
    border: 2px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(1, 142, 238, 0.02), rgba(1, 142, 238, 0.05));
}

.project-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.project-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.project-card:hover .project-icon {
    transform: scale(1.1) rotate(5deg);
}

.project-icon i {
    font-size: 1.5rem;
    color: var(--text-light);
}

.project-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.project-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: rgba(1, 142, 238, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(1, 142, 238, 0.2);
    transition: var(--transition);
}

.tech-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.project-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

.demo-link {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(1, 142, 238, 0.3);
}

.demo-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 142, 238, 0.4);
}

.github-link {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.github-link:hover {
    background: #24292e;
    color: white;
    border-color: #24292e;
    transform: translateY(-2px);
}

.project-link i {
    font-size: 0.9rem;
}

/* 联系部分 */
.contact {
    background: var(--background-gray);
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.contact-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.contact-link:hover {
    background: var(--primary-color);
    color: var(--text-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.contact-link i {
    font-size: 1.25rem;
}

/* 页脚 */
.footer {
    background: var(--text-primary);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 0;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--background-light);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow-light);
        padding: 2rem 0;
    }

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

    .nav-toggle {
        display: flex;
    }

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

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

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

    .avatar {
        width: 200px;
        height: 200px;
    }

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

    .hero-buttons {
        justify-content: center;
    }

    .contact-links {
        grid-template-columns: 1fr;
    }

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

    section {
        padding: 3rem 0;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .nav-container {
        padding: 0 15px;
    }

    .hero-container {
        padding: 0 15px;
    }

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

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

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .project-card {
        padding: 1.5rem;
    }

    .avatar {
        width: 150px;
        height: 150px;
    }
}

/* 滚动行为 */
html {
    scroll-behavior: smooth;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 深色主题下的特殊样式调整 */
@media (prefers-color-scheme: dark) {
    .tech-tag {
        background: rgba(1, 142, 238, 0.2);
        border-color: rgba(1, 142, 238, 0.3);
    }
    
    .project-card.featured {
        background: linear-gradient(135deg, rgba(1, 142, 238, 0.05), rgba(1, 142, 238, 0.1));
    }
    
    .github-link:hover {
        background: #f6f8fa;
        color: #24292e;
        border-color: #f6f8fa;
    }
    
    .contact-link:hover {
        background: var(--primary-color);
        color: var(--text-light);
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

.hero-image {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}