/* ===== 基础重置与变量 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #06b6d4;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-alt: #f8fafc;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

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

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

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

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    font-size: 1rem;
}

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

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

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

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

/* ===== 英雄区 ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #f5f7ff 0%, #e0f2fe 100%);
    position: relative;
    padding-top: 70px;
}

.hero-content {
    max-width: 700px;
}

.greeting {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 32px;
    opacity: 0.85;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--text-light);
    border-bottom: 2px solid var(--text-light);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ===== 通用区块 ===== */
.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 12px auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 48px;
    font-size: 1.05rem;
}

/* ===== 关于我 ===== */
.about {
    background: var(--bg-color);
}

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

.about-avatar {
    display: flex;
    justify-content: center;
}

.avatar-img {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    border: 4px solid white;
    transition: var(--transition);
}

.avatar-img:hover {
    transform: scale(1.03);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.15);
}

.about-text h3 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.about-text p {
    margin-bottom: 16px;
    color: var(--text-light);
}

.about-info {
    list-style: none;
    margin-top: 24px;
}

.about-info li {
    margin-bottom: 12px;
    color: var(--text-color);
}

.about-info strong {
    color: var(--primary-color);
    margin-right: 8px;
}

/* ===== 技能 ===== */
.skills {
    background: var(--bg-alt);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.skill-card {
    background: white;
    padding: 32px 24px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.skill-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.skill-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===== 作品 ===== */
.projects {
    background: var(--bg-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.project-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.project-image {
    height: 180px;
    background: linear-gradient(135deg, #e0e7ff 0%, #cffafe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.2rem;
}

.project-info {
    padding: 24px;
}

.project-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.project-info p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-tags span {
    background: #eef2ff;
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== 联系 ===== */
.contact {
    background: var(--bg-alt);
}

.contact-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
}

.contact-form {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
    justify-content: center;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.contact-item h4 {
    margin-bottom: 4px;
    color: var(--text-color);
}

.contact-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===== 页脚 ===== */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(31, 41, 55, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    padding: 16px 0;
    text-align: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.footer p {
    margin-bottom: 4px;
}

.footer-note {
    color: #d1d5db;
    font-size: 0.8rem;
}

/* 为固定页脚腾出空间 */
body {
    padding-bottom: 90px;
}

.contact {
    padding-bottom: 140px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .about-info {
        display: inline-block;
        text-align: left;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: center;
        padding: 24px 0;
        gap: 20px;
        box-shadow: var(--shadow);
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition);
    }

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

    .menu-toggle {
        display: flex;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

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

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

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

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

    .section {
        padding: 70px 0;
    }

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

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

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

    .avatar-img {
        width: 180px;
        height: 180px;
    }

    .contact-form {
        padding: 24px;
    }
}
