/* public/style.css */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 暗黑模式 (可选, 通过 JS 或系统设置触发) */
/*
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ccc;
    }
    header, footer {
        background-color: #2a2a2a;
        border-color: #444;
    }
    section {
        background-color: #252525;
        border-color: #404040;
    }
    a {
        color: #6fa8dc;
    }
    .gallery-item {
         background-color: #333;
         border-color: #555;
    }
    h1, h2 {
        color: #eee;
    }
}
*/

.container {
    max-width: 960px;
    margin: auto;
    overflow: hidden;
    padding: 0 20px;
}

header {
    background: #fff;
    color: #333;
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header nav ul {
    padding: 0;
    list-style: none;
    text-align: center;
    margin: 0;
}

header nav ul li {
    display: inline;
    margin: 0 15px;
}

header nav ul li a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: #007bff;
}

main {
    padding: 20px;
    max-width: 960px;
    margin: 20px auto;
}

section {
    background: #fff;
    margin-bottom: 20px;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

h1, h2 {
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #007bff;
    display: inline-block;
    padding-bottom: 5px;
}

h1 {
    font-size: 2.5em;
    text-align: center;
    border-bottom: none;
    margin-bottom: 5px;
}

#hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    object-fit: cover; /* 确保图片不变形 */
}

.subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 0;
}

#about p, #contact p {
    margin-bottom: 10px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 4 / 3; /* 保持图片比例 */
    object-fit: cover;
    background-color: #ccc; /* 占位符背景色 */
}

.gallery-item p {
    text-align: center;
    padding: 10px;
    margin: 0;
    font-size: 0.9em;
    color: #555;
    background: #fff;
}

.portfolio-note {
    font-size: 0.8em;
    color: #777;
    text-align: center;
    margin-top: 20px;
}


#contact a {
    color: #007bff;
    text-decoration: none;
}

#contact a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background: #e9ecef;
    color: #666;
    font-size: 0.9em;
    border-top: 1px solid #ddd;
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    .avatar {
        width: 120px;
        height: 120px;
    }
    header nav ul li {
        margin: 0 10px;
    }
    main {
        padding: 10px;
    }
    section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header nav ul {
       display: flex;
       flex-direction: column;
       align-items: center;
    }
     header nav ul li {
        margin: 5px 0;
    }
    .gallery {
        grid-template-columns: 1fr; /* 移动端单列显示 */
    }
}

/* 平滑滚动效果 */
html {
  scroll-behavior: smooth;
}