
:root {
    --primary-color: #66A2D8FF;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --grey-color: #6c757d;
    --white-color: #ffffff;
    --body-bg: var(--white-color);
    --text-color: var(--dark-color);
    --card-bg: var(--white-color);
    --card-border: #e9ecef;
    --header-shadow: rgba(0,0,0,0.05);
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --transition-speed: 0.3s;
}


html[data-theme='dark'] {
    --dark-color: #f8f9fa;
    --light-color: #212529;
    --grey-color: #adb5bd;
    --white-color: #121212;
    --body-bg: #121212;
    --text-color: #f8f9fa;
    --card-bg: #1e1e1e;
    --card-border: #333;
    --header-shadow: rgba(255,255,255,0.1);
}

/* 全局重置和基础样式 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.7;
    background-color: var(--body-bg);
    color: var(--text-color);
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

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

/* 导航栏 */
.main-header {
    background: var(--body-bg);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px var(--header-shadow);
    transition: background-color var(--transition-speed) ease;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--grey-color);
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

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


.settings-switches {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-switch {
    display: flex;
    background: var(--light-color);
    border-radius: 20px;
    padding: 4px;
}

.lang-btn {
    padding: 2px 10px;
    color: var(--grey-color);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

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

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--grey-color);
    transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

#theme-toggle:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}


/* 内容区域 */
.hero, .content-section.bg-light {
    background-color: var(--light-color); /* 应用变量 */
    transition: background-color var(--transition-speed) ease;
}

.hero {padding: 6rem 0; text-align: center;}
.hero-title {font-size: 3.5rem; margin-bottom: 1rem; font-weight: 700;}
.hero-subtitle {font-size: 1.25rem; color: var(--grey-color); max-width: 600px; margin: 0 auto;}
.content-section {padding: 5rem 0;}
.section-title {text-align: center; font-size: 2.5rem; margin-bottom: 3rem; font-weight: 600; color: var(--text-color);}

/* 关于我 About Me */
.about-content {display: flex; align-items: center; gap: 3rem;}
.about-text {flex: 2;}
.about-image {flex: 1; max-width: 250px;}
.about-image img {width: 100%; border-radius: 50%; box-shadow: 0 4px 15px rgba(0,0,0,0.1);}

/* 项目 Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, background-color var(--transition-speed) ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.project-image-container {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: #f8f9fa;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform var(--transition-speed) ease;
}

.project-card:hover .project-image {
    transform: scale(1.03); /* 减小缩放比例 */
}

.project-content {
    padding: 1.5rem;
}

.project-card h3 {
    font-size: 1.3rem;
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.3;
}

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

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

.project-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
    border: 1px solid transparent;
}

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

.demo-btn:hover {
    background: #4a90c2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(90, 159, 212, 0.3);
}

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

.details-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(90, 159, 212, 0.3);
}

.project-btn svg {
    width: 16px;
    height: 16px;
}


@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-image-container {
        height: 200px;
    }

    .project-card h3 {
        font-size: 1.2rem;
    }

    .project-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .project-btn {
        justify-content: center;
        width: 100%;
    }
}


/* CV列表样式 */
.cv-container {
    max-width: 800px;
    margin: 0 auto;
}

.cv-item {
    padding-left: 1.5rem;
    border-left: 3px solid var(--primary-color);
    position: relative;
    margin-bottom: 2.5rem;
}


.cv-item::before {
    content: '';
    position: absolute;
    left: -9px;
    top: 5px;
    width: 15px;
    height: 15px;
    background-color: var(--primary-color);
    border-radius: 50%;
    border: 3px solid var(--body-bg);
}

.cv-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cv-meta {
    color: var(--grey-color);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.cv-description {
    line-height: 1.6;
}

/* 联系 Contact */
.social-links {margin-top: 2rem;}
.social-links a {text-decoration: none; color: var(--primary-color); border: 1px solid var(--primary-color); padding: 0.5rem 1.5rem; border-radius: 20px; margin: 0 0.5rem; transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;}
.social-links a:hover {background-color: var(--primary-color); color: var(--white-color);}

/* 页脚 Footer */
.main-footer {background: var(--light-color); color: var(--grey-color); text-align: center; padding: 2rem 0; font-size: 0.9rem; transition: background-color var(--transition-speed) ease;}


@media (max-width: 768px) {
    .hero-title {font-size: 2.5rem;}
    .main-header .container {flex-direction: column; gap: 1rem;}
    .about-content {flex-direction: column; text-align: center;}
}



.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    max-width: 800px;
    margin: 0 auto;
}

.hero-text {
    flex: 1;
}

.hero-avatar {
    flex: 0 0 auto;
}

.avatar-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transition: transform var(--transition-speed) ease;
}

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


.main-nav a.active {
    color: var(--primary-color);
}


@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

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

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

    .main-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}


.inline-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-speed) ease;
}

.inline-link:hover {
    border-bottom-color: var(--primary-color);
}


.hero-subtitle {
    font-size: 1.1rem;
    color: var(--grey-color);
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: left;
}

.hero-subtitle:last-of-type {
    margin-bottom: 0;
}


@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .hero-subtitle {
        text-align: center;
    }

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

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

    .main-header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}


/* CV Section  */
.cv-header {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cv-header .section-title {
    text-align: center;
    margin-bottom: 0;
    margin-right: 0;
}

.cv-download-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(80px, -50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.cv-download-btn:hover {
    background: #4a90c2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cv-download-btn svg {
    width: 18px;
    height: 18px;
}


@media (max-width: 768px) {
    .cv-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .cv-download-btn {
        position: static;
        transform: none;
        display: inline-flex;
    }

    .cv-download-btn:hover {
        background: #4a90c2;
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

    .cv-header-info {
        flex-direction: column;
        gap: 0.25rem;
    }

    .cv-date {
        white-space: normal;
    }

    .cv-download-btn {
        font-size: 0.85rem;
        padding: 0.6rem 1.2rem;
    }
}

/* Contact Section */
.contact-intro {
    font-size: 1.1rem;
    color: var(--grey-color);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-align: left;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.contact-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.contact-details h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.contact-details p {
    margin: 0;
    line-height: 1.6;
    color: var(--grey-color);
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.contact-link:hover {
    color: #4a90c2;
    text-decoration: underline;
}


@media (max-width: 768px) {
    .contact-info {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-item {
        padding: 1.25rem;
    }

    .contact-icon {
        width: 40px;
        height: 40px;
    }

    .contact-icon svg {
        width: 20px;
        height: 20px;
    }
}





