/* Basic styles for layout and typography */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
}

header {
    background-color: #657667;
    color: #fff;
    padding: 20px;
    text-align: center;
}

header h1 {
    margin: 0;
}

nav {
    background-color: #a4a3a3;
    overflow: hidden;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    white-space: nowrap;  /* 防止文字换行 */
    overflow-x: auto;     /* 允许水平滚动 */
    -webkit-overflow-scrolling: touch; /* 在iOS上实现平滑滚动 */
    scrollbar-width: none;  /* 隐藏Firefox滚动条 */
    text-align: center;  /* 导航栏整体居中 */
    display: flex;       /* 使用flex布局 */
    justify-content: center; /* flex项目水平居中 */
    padding: 0 20px;    /* 添加一些左右内边距，避免内容贴边 */
}

nav a {
    color: white;
    text-decoration: none;
    padding: 14px 20px;
    display: inline-block;
    text-align: center;  /* 确保链接文本居中 */
}

nav a:hover {
    background-color: #575757;
}

a {
    color: #657667;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover, a:active {
    color: #3d4a3e;
}

.container {
    max-width: 1200px;
    margin: 0 20vw;
    padding: 20px;
    /* 移除padding-top，sticky不会遮挡内容 */
}

.about, .projects, .contact {
    margin-bottom: 40px;
}

.about img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.projects img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px;
}

.quote {
    font-size: 1.2em;
    font-style: italic;
    text-align: center;
    margin: 1.25em 0;
    color: #444;
}

body {
    background-color: #ffffff;  /* 设置整个页面的背景为白色 */
}

.about-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap; /* 在小屏幕上自动换行 */
    margin-top: 20px;
}

.about-text {
    flex: 1;
    min-width: 250px;
}

.about-photo {
    flex: 0 0 auto;
}

.profile-photo {
    height: 30vw;
    max-height: 500px;
    width: auto;
    /* width: 15vw;
    max-width: 250px;
    height: auto; */
    border-radius: 8px;
    display: block;
}


/* 响应式设计：适配窄屏设备 */
@media (max-width: 768px) {
    .container {
        margin: 0 5vw;
        padding: 10px;
    }

    .about-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .about-photo {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .profile-photo {
        width: 60vw;
        max-width: 90vw;
        height: auto;
        object-fit: cover;
    }

    nav a {
        padding: 12px 15px;  /* 调整padding使触摸更容易 */
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    header {
        padding: 12px;
    }

    .container {
        margin: 0 2vw;
        padding: 6px;
    }

    .profile-photo {
        width: 90vw;
        max-width: 100vw;
        height: auto;
        object-fit: contain;
    }

    .about-text {
        min-width: 0;
        font-size: 1em;
    }

    nav a {
        padding: 10px 12px;
        font-size: 0.9em;
    }
}

/* 隐藏Webkit浏览器的滚动条 */
nav::-webkit-scrollbar {
    display: none;
}