*{
    padding:0;
    margin:0;

}
body{
    background-color: rgba(192, 159, 210, 0.911);
}
h1, h4, p, blockquote {
    color: aliceblue;
}

/*border: 5px darkgray dashed;*/
header {
    background-color: rgba(244, 245, 191, 0.829);
    padding: 20px;
    text-align: center;
    background-image: url(../images/微信图片_20251120211255_242_39-modified.png);
    background-position: 65% 50%;
    background-size:contain;
    background-repeat: no-repeat;
    position: relative;
}
/* 添加半透明遮罩调整整体透明度 */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(228, 227, 192, 0.686); /* 调整遮罩透明度 */
    z-index: 1;
}

/* 确保文字在遮罩上方 */
header h1,
header blockquote {
    position: relative;
    z-index: 2;
}

header h1 {
    color: #880101;
    font-size: 2rem;
    margin-bottom: 10px;
}
header blockquote {
    color: #a00202fb;
    font-style: italic;
    font-size: 1rem;
    margin: 0;
}
nav {
    background-color: rgba(108, 180, 193, 0.763);

    padding: 10px;
    border-radius: 4px;
}

nav li{
    color: rgb(250, 249, 249);
    flex: 1;
    text-align: center;
}

nav a {
    color: rgba(241, 237, 237, 0.757);
    text-decoration: none;
    padding: 12px 0;
    display: block;
    transition: background-color 0.3s;
    border-radius: 5px;
    font-size: 17px;
}

nav ul li a:hover {
    text-decoration:underline;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-around;

}


main {
    padding: 20px;
    padding-bottom: 50px;
    margin-bottom: 10px;
    background-image: url(../images/9477750.jpg);
    background-size:cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
}

.welcome {
    margin-top: 30px;
    margin-bottom: 50px;
    text-align: center;
    line-height: 1.8;
    justify-content: center;
    
}
 
.welcome h4 {
    margin-bottom: 15px;
    text-shadow: 0 0 9px rgba(255, 255, 255, 0.8),
                 0 0 18px rgba(255, 255, 255, 0.6),
                 0 0 27px rgba(255, 255, 255, 0.4);
}

.welcome p {
    max-width: 1000px;
    line-height: 1.8;
    margin-left: 15px;
    margin-right: 15px;
    padding-left: 10px;
    padding-right: 10px;
    background-color: #d4d4d420;
    border-radius: 8px;
    /* 添加居中样式 */
    margin: 0 auto; /* 水平居中 */
    text-align: center; /* 文字内容居中 */
}

.image{
    margin-top: 10px;
    text-align: center;
    
}
/* 添加图片样式限制 */
.image img {
    max-width: 25%; /* 图片最大宽度为容器的80% */
    height: auto; /* 高度自动按比例调整 */
    border-radius: 8px; /* 可选：添加圆角 */
}


.music-player {
    position: fixed; /* 添加这行 */
    bottom: 20px;   /* 添加这行 */
    right: 20px;    /* 添加这行 */
    z-index: 1000;  /* 添加这行 */
}
.music-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
}

.music-toggle {
    background: transparent;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    margin: 0;
    font-family: inherit;
}

.music-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.music-name {
    color: white;
    font-size: 12px;
    font-style: italic;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

.section{
    background-color: rgba(245, 245, 220, 0.788);
    padding: 20px;
    border-radius: 5px;
}
/* 画廊布局 */
.gallery-a {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    padding: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(190, 190, 190, 0.106);
    aspect-ratio: 4/3;
    transition: all 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}
.caption-a {
    position: absolute; /* 绝对定位 */
    top: 0;
    left: 0;
    width: 100%;    /* 宽度占满父元素 */
    height: 100%;   /* 高度占满父元素 */
    
    background-color: rgba(54, 54, 54, 0.517); /* 黑色背景，0.7透明度 */
    color: #de6ed6;    /* 文字颜色 */
    
    /* 使用 Flex 布局让文字垂直水平居中 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
   
    padding: 15px;  /* 防止文字贴边 */
    box-sizing: border-box;
    
    /* 动画效果 */
    opacity: 0;           /* 初始透明度为0（隐藏） */
    transition: all 0.3s ease; /* 过渡动画 */
    z-index: 10;          /* 确保在图片上方 */


}
.caption-a p{
    font-size: 12px;
}

.gallery-item:hover .caption-a {
    opacity: 1; /* 显示 */
}


.more{
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: rgba(3, 56, 56, 0.24);
     /* 使用 Flex 布局让文字垂直水平居中 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 15px;  /* 防止文字贴边 */
    box-sizing: border-box;
}

.imageframe {
            
    border: 6px solid #64439961;
    width: 100%;
    /* 移除固定高度 */
    /* height: 220px; */
    /* 添加宽高比控制 */
    aspect-ratio: 4/3; /* 默认使用3:4比例 */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.discribe{
    max-width: 280px;
            margin-top: 20px;
            text-align: center;
            width: 100%;
}
        
        .discribe h5 {
            color: #2d3748;
            margin-bottom: 8px;
            font-size: 18px;
            font-weight: 500;
        }
        
        .discribe p {
            color: #718096;
            font-size: 1rem;
            line-height: 1.5;
        }
.imageframe:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.imageframe:hover img {
    transform: scale(1.05);
}
.link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20; /* 确保它比 caption (z-index:10) 还要高，或者一样高 */
}


.section-title{
    margin: 10px;
    padding: 10px;
    background-color: #b8b8b863;
}
 .gallery {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 40px;
            padding: 20px 0;
            
        }
        


.image-frame {
    position: relative; 
    border: 6px solid #64439961;
    width: 100%;
    /* 移除固定高度 */
    /* height: 220px; */
    /* 添加宽高比控制 */
    aspect-ratio: 4/3; /* 默认使用3:4比例 */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 为不同比例的图片添加专门的类 */
.square-image {
    /* 添加最大宽度限制 */
        max-width: 150px;
        margin: 0 auto;
    aspect-ratio: 1/1; /* 正方形图片 */
}

.portrait-image {
    /* 添加最大宽度限制 */
        max-width: 200px;
        margin: 0 auto;
    aspect-ratio: 3/4; /* 纵向图片 */
}

.landscape-image {
    /* 添加最大宽度限制 */
        max-width: 250px;
        margin: 0 auto;
    aspect-ratio: 4/3; /* 横向图片 */
}

.image-frame:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 这个保持不变，很重要 */
    transition: transform 0.5s ease;
}

.image-frame:hover img {
    transform: scale(1.05);
}
        .caption {
            max-width: 280px;
            margin-top: 20px;
            text-align: center;
            width: 100%;
        }
        
        .caption h5 {
            color: #2d3748;
            margin-bottom: 8px;
            font-size: 18px;
            font-weight: 500;
        }
        
        .caption p {
            color: #718096;
            font-size: 1rem;
            line-height: 1.5;
        }
  /* 让滚动变平滑 */
html {
    scroll-behavior: smooth;
}

/* 侧边导航栏样式 */
.side-nav {
    position: fixed;    /* 固定在屏幕上 */
    left: 20px;         /* 距离左边20px */
    top: 65%;           /* 垂直居中 */
    transform: translateY(-50%); /* 配合top实现真正居中 */
    width: 100px;
    background-color: rgba(139, 139, 139, 0.462); /* 深紫色半透明 */
    padding: 15px 10px;
    border-radius: 3px;
    z-index: 800;      /* 确保在最上层 */
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.side-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column; /* 垂直排列 */
    gap: 10px;
    padding: 0;
    margin: 0;
}

.side-nav li a {
    color: #93559c;
    text-decoration: none;
    font-size: 16px;
    display: block;
    padding: 8px;
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.side-nav li a:hover {
    color: white;
    transform: translateX(5px); /* 悬停微动 */
}

/* 重点：给 main 腾出左侧空间 */
main {
    padding: 20px;
    padding-left: 160px; /* 增加左外边距，防止内容被 side-nav 挡住 */
    /* 其余属性保持不变 */
}

/* 修复锚点跳转后的“顶格”问题 */
/* 点击跳转后，标题不会紧贴浏览器最顶端，留出一点呼吸空间 */
.section {
    scroll-margin-top: 20px; 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}


.web{
    padding: 16px;
    background-color: rgba(200, 214, 226, 0.575);
    border: 6px solid #64439961;
    border-radius: 5px;
}

/* 响应式调整：如果屏幕太小（手机），隐藏侧边栏防止遮挡 */
@media (max-width: 900px) {
    .side-nav {
        display: none; 
    }
    main {
        padding-left: 20px;
    }
} 