html {
    scroll-behavior: smooth;
}

/* 全局重置保持不变 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-yellow: #fffdf2; 
    --text-main: #111111;
    --text-muted: #666666;
    --accent: #ff6f61;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --nav-hover-bg: #e0e0e0; /* 悬停时的灰色背景色 */
}

body {
    background-color: var(--bg-yellow);
    font-family: var(--font-sans);
    color: var(--text-main);
    line-height: 1.5;
}

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

/* 导航栏 */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    background-color: rgba(255, 253, 242, 0.95); 
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

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

.logo-text {
    font-family: var(--font-serif);
    font-size: 22px;
    letter-spacing: 2px;
    font-weight: 700;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 10px; /* 稍微缩小 gap，让悬停框之间有呼吸感 */
}

/* 导航链接基础样式 */
nav a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px; /* 增加内边距，让背景框更大 */
    border-radius: 4px; /* 背景框圆角 */
    transition: all 0.3s ease; /* 平滑过渡效果 */
}

/* 鼠标移动到任意导航上时的灰色背景效果 */
nav a:hover {
    background-color: var(--nav-hover-bg);
    color: var(--text-main);
}

/* Hero 区域 */
.hero {
    padding: 180px 0 100px 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 64px;
    font-family: var(--font-serif);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* 作品展示 */
.work {
    padding-bottom: 100px;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px 40px;
}

.project-card {
    display: flex;
    flex-direction: column;
}

/* 修改此部分 */
.project-image {
    width: 100%;
    /* 将比例改为更接近黄金比例或自适应比例，1.2 或 1 均可 */
    aspect-ratio: 1.2; 
    border-radius: 12px; /* 稍微加大圆角，更有现代感 */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    overflow: hidden;
    /* 增加一个非常淡的投影，增加层次感 */
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); 
    transition: all 0.4s ease;
}

/* 修改此部分：关键！ */
.project-image img {
    /* 将 70% 改为 85% 或 90%，甚至如果是填充类的图可以用 100% */
    max-width: 100%; 
    height: auto;
    /* 增加抗锯齿渲染 */
    image-rendering: -webkit-optimize-contrast;
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

/* 增加鼠标悬停的视觉反馈 */
.project-card:hover .project-image {
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.project-card:hover .project-image img {
    transform: scale(1.02); /* 悬停时图片轻微放大 */
}

.project-info h3 {
    font-family: var(--font-serif);
    font-size: 28px;
    margin-bottom: 8px;
}

.project-sub {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

.view-btn {
    align-self: flex-start;
    padding: 8px 20px;
    border: 1px solid #111;
    color: #111;
    text-decoration: none;
    font-size: 14px;
    transition: 0.3s;
}

.view-btn:hover {
    background: #111;
    color: #fff;
}

/* 页脚/联系 */
.contact {
    padding: 80px 0;
    text-align: center;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.contact h2 {
    font-size: 32px;
    margin-bottom: 15px;
}

.contact-details p {
    color: var(--text-muted);
    margin-bottom: 5px;
}

.email-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
}

.social-icons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 25px;
}

.social-icons a {
    color: #111;
    font-size: 22px;
    transition: 0.3s;
}

.social-icons a:hover {
    color: var(--accent);
}

/* 响应式 */
@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    .hero-content h1 {
        font-size: 40px;
    }
}

/* ---     About Me 页面专属样式      About Me 页面专属样式      About Me 页面专属样式      About Me 页面专属样式      About Me 页面专属样式 --- */

.about-hero {
    padding: 180px 0 100px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* 左右比例 */
    gap: 80px;
    align-items: flex-start;
}

.about-title {
    font-family: var(--font-sans);
    font-size: 42px;
    line-height: 1.2;
    font-weight: 400;
    margin-bottom: 60px;
}

.serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
}

.about-item {
    display: flex;
    margin-bottom: 40px;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 20px;
    flex-wrap: wrap; /* 如果空间不够，允许内容换行 */
}
/* 针对教育信息的排列进行优化 */
.about-education-container {
    flex: 1;
    display: flex;
    gap: 40px; /* 增加两个学历之间的间距 */
    flex-wrap: wrap; /* 保证在小屏幕上自动堆叠 */
}

.edu-row {
    flex: 1;
    min-width: 200px; /* 保证每个学历至少有200px宽度，不会挤在一起 */
    display: flex;
    flex-direction: column; /* 改为垂直排列：专业在上，学校在下 */
    justify-content: flex-start;
    margin-bottom: 20px;
}

.about-item-flex {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 20px;
}

.sub-column {
    flex: 1;
}

.label {
    flex: 0 0 150px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #999;
}

.about-item p, .about-item-flex li {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.6;
    list-style: none;
}

.edu-row {
    flex: 1;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.edu-meta {
    font-size: 13px;
    color: #999;
}

.resume-btn {
    margin-top: 20px;
    border-radius: 50px; /* 圆角按钮 */
    background: #000;
    color: #fff;
}

/* 照片区域样式 */
.about-image-area {
    position: sticky;
    top: 180px;
    display: flex;
    justify-content: center;
}

.photo-circle-bg {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); /* 渐变圆底，参考图2风格 */
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.my-photo {
    width: 90%; /* 根据你的 PNG 比例调整 */
    height: auto;
    margin: 0 auto;
    display: block;
    z-index: 2;
}

/* 移动端适配 */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    .about-image-area {
        order: -1; /* 手机端照片在上 */
        position: static;
        margin-bottom: 40px;
    }
}