* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

html, body {
    overflow-y: scroll;
    height: 100%;
    overflow: hidden; 
}

body {
    line-height: 1.6;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, background-color 0.5s ease, color 0.5s ease;
}

body.loaded {
    opacity: 1;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.container {
    overflow-y: auto; 
    height: 100vh;
    scrollbar-width: none; /* Firefox */
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* 粘性页首样式 */
.sticky-header {
    position: sticky;
    top: 0;
    background-color: var(--header-bg);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.menu-icon {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
    margin-left: 20px;
    transition: color 0.3s ease-in-out;
}

/* 浅色主题 */
.light-theme {
    --bg-color: #f5f5f5;
    --text-color: #333;
    --header-bg: linear-gradient(135deg, #003366, #006699);
    --title-color: #003366;
    --interest-bg: #fff;
    --interest-hover-bg: #ffeb3b;
    --portfolio-bg: #fff;
    --portfolio-hover-bg: #cce7ff;
    --contact-bg: #ffcc00;
    --footer-bg: #003366;
    --footer-bg2: #fff;
}

/* 深色主题 */
.dark-theme {
    --bg-color: #0d1b2a;
    --text-color: #fff;
    --header-bg: linear-gradient(135deg, #007991, #78ffd6);
    --title-color: #78ffd6;
    --interest-bg: #1f2a44;
    --interest-hover-bg: #3d5a80;
    --portfolio-bg: #1f2a44;
    --portfolio-hover-bg: #3d5a80;
    --contact-bg: #007991;
    --footer-bg: #003366;
    --footer-bg2: #007991;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    scrollbar-width: none;
}

.header {
    text-align: center;
    padding: 50px 20px;
    background: var(--header-bg);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

.header p {
    font-size: 1.5rem;
    margin-top: 10px;
    opacity: 0.9;
}

.about, .skills, .portfolio, .contact {
    margin-top: 50px;
    text-align: center;
}

.about h2, .skills h2, .portfolio h2, .contact h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--title-color);
}

.about p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-color)
}

.interests {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.interests .interest-item {
    padding: 20px;
    background-color: var(--interest-bg);
    color: var(--text-color);
    margin: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.interests .interest-item:hover {
    transform: translateY(-10px);
    background-color: var(--portfolio-bg);
}

.interests h3 {
    font-size: 1.75rem;
    margin-bottom: 10px;
    color: var(--title-color);
}

.interests p {
    font-size: 1.1rem;
    color: var(--text-color); 
}

.sam-card {
    margin-top: 50px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-title {
    font-size: 2.8rem;
    font-weight: bold;
    color: var(--title-color);
    margin-bottom: 30px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card {
    background: linear-gradient(145deg, #d0e1f9, #b3d5ff); /* 温和的渐变色 */
    width: 700px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); /* 轻微的阴影 */
    display: flex;
    flex-direction: row;
    padding: 25px;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.left-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 35%;
    justify-content: center;
}

.left-container img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid #b8cce4; /* 亮色边框 */
    margin-bottom: 15px;
}

.left-container h2 {
    font-size: 28px;
    font-weight: 600;
    color: #170bf8; /* SamHacker标题颜色，温和深色 */
    text-shadow: #333;
    text-align: center;
    margin-bottom: 10px;
}

.right-container {
    width: 60%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-left: 20px;
}

h3 {
    font-size: 24px;
    font-weight: 600;
    color: #156ff6; /* 个人资料标题颜色，温和深色 */
    margin-bottom: 8px;
}

.card p {
    font-size: 16px;
    line-height: 1.5;
    color: #000000; /* 文字颜色更深，保持可读性 */
    margin-bottom: 15px;
}

table {
    margin-top: 10px;
    width: 100%;
    font-size: 16px;
    color: #000000; /* 文字颜色更深 */
    border-collapse: collapse;
}

td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #b8cce4; /* 亮色边框 */
}

td:first-child {
    font-weight: bold;
    color: #154ef6; /* 更深的颜色 */
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    justify-content: flex-start;
}

.social-icons a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff; /* 浅白色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.social-icons a:hover {
    background-color: #b8cce4; /* 亮色悬浮 */
}

.social-icons i {
    color: #2f4050; /* 图标颜色与标题一致 */
    font-size: 20px;
}

/* Y形分割线样式 */
.divider {
    position: absolute;
    top: 0;
    left: 40%;
    width: 1px;
    height: 100%;
    background-color: #b8cce4; /* 亮色分割线 */
}

@media only screen and (max-width: 800px) {
    .card {
        flex-direction: column;
        width: 90%;
        padding: 20px;
    }

    .left-container, .right-container {
        width: 100%;
        align-items: center;
    }

    .social-icons {
        justify-content: center;
    }
}

.skills {
    margin-top: 60px;
    text-align: center;
}

.skills h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--title-color)
}

.skill {
    margin-bottom: 20px;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
}

.skill h3 {
    font-size: 1.75rem;
    margin-bottom: 10px;
    color: var(--title-color)
}

.skill-bar {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.skill-bar .progress {
    height: 30px;
    line-height: 30px;
    color: white;
    text-align: right;
    padding-right: 10px;
    font-weight: bold;
    border-radius: 10px;
}
.progress.html {
    width: 80%;
    background-color: #4CAF50; 
}

.progress.css {
    width: 70%;
    background-color: #2196F3; 
}

.progress.javascript {
    width: 25%;
    background-color: #FFC107; 
}

.progress.photography {
    width: 60%;
    background-color: #FF5722; 
}

.portfolio {
    margin-top: 60px;
}

.portfolio h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 30px;
}

.portfolio-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.portfolio-item {
    flex: 1;
    margin: 10px;
    background-color: var(--portfolio-bg);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    background-color: var(--portfolio-hover-bg);
}

.portfolio-item a {
    text-decoration: none;
    color: var(--title-color);
    font-size: 1.25rem;
    font-weight: bold;
}

.contact {
    text-align: center;
    margin-top: 50px;
}

.contact h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--title-color);
}

.contact a {
    text-decoration: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 10px 20px;
    background-color: var(--contact-bg);
    border-radius: 5px;
    transition: background-color 0.3s ease-in-out;
}

.contact a:hover {
    background-color: #ffa500;
}

footer {
    margin-top: 50px;
    text-align: center;
    padding: 30px;
    background-color: var(--footer-bg);
    color: #fff;
    border-radius: 10px;
}

footer p {
    font-size: 0.9rem;
}

footer .social-links a {
    color: #fff;
    margin: 0 10px;
    text-decoration: none;
    font-size: 1.5rem;
}

footer .social-links {
    margin-top: 15px;
}

footer .social-links a:hover {
    color: #ffcc00; 
}

.theme-switch {
    font-weight: bold;
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px;
    background-color: var(--footer-bg2);
    color: var(--title-color);
    border: 1px solid var(--portfolio-hover-bg);
    border-radius: 5px;
    cursor: pointer;
    z-index: 1000;
    
}

/* 侧边栏样式 */
.sidebar {
position: fixed;
top: 0;
left: -300px;
width: 300px;
height: 100%;
background-color: #34495e; /* 更改背景色为更舒适的深蓝色 */
color: #ecf0f1;
transition: left 0.3s ease-in-out;
padding: 20px;
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.7);
z-index: 101;
display: flex;
flex-direction: column;
justify-content: space-between;
}

.sidebar.open {
left: 0;
}

.sidebar h2 {
font-size: 2rem;
margin-bottom: 20px;
}

.sidebar a {
display: block;
margin-bottom: 15px;
color: #ecf0f1;
text-decoration: none;
font-size: 1.2rem;
transition: color 0.3s ease-in-out;
}

.sidebar a:hover {
color: #ffeb3b; /* 更改悬停时的颜色 */
}

.sidebar .close-btn {
position: absolute;
top: 20px;
right: 20px;
font-size: 1.5rem;
cursor: pointer;
color: #ecf0f1;
}

.sidebar .nav-items {
flex-grow: 1;
display: flex;
flex-direction: column;
gap: 20px;
}

.sidebar .social-icons {
display: flex;
justify-content: space-around;
margin-top: 20px;
}

.sidebar .social-icons a {
color: #ecf0f1;
font-size: 1.5rem;
transition: color 0.3s ease-in-out;
}

.sidebar .social-icons a:hover {
color: #ffeb3b;
}

form {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 20px auto;
    background-color: var(--portfolio-bg);
    color: var(--title-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

form label {
    margin-bottom: 5px;
    font-weight: bold;
}

form input, form textarea {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid var(--portfolio-hover-bg);
    border-radius: 5px;
}   

form button {
    padding: 10px;
    background-color: #003366; /* 深蓝色 */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

form button:hover {
    background-color: #005580; /* 深蓝色变暗 */
}

@media (max-width: 768px) {
    .interests, .portfolio-items {
        flex-direction: column;
        align-items: center;
    }
    
    .interests, .portfolio-items {
        grid-template-columns: 1fr
    }

    .interests .interest-item, .portfolio-item {
        max-width: 100%;
    }

}