html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%; 
  overflow-x: hidden; 
  background-color: transparent; /* 整个页面的背景就是雨点 */
  font-family: Arial, sans-serif;
}

/* 1. 全屏雨点容器及画布：固定在最底层 */
#rain-background-container {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* 最底层 */
    pointer-events: none; /* 允许鼠标点击穿透 */
}
#rain-background-container canvas {
    display: block; 
}


/* 2. 主画布容器 (蓝色互动图形)：正常流动，半透明背景，在雨点之上 */
#main-sketch-container {
    width: 100%;
    height: 600px; 
    position: relative; /* 正常流动 */
    z-index: 5; /* 在雨点之上 */
    background-color: rgba(0, 0, 0, 0.4); /* 半透明黑色背景，让雨点隐约可见 */
}
#main-sketch-container canvas {
    display: block;
}


/* 3. 作品集容器：在雨点之上，半透明背景 */
.portfolio-container {
    position: relative; 
    z-index: 5; 
    background-color: transparent;
 /* 半透明深灰色背景，让雨点隐约可见 */
    padding-top: 50px; 
    padding-bottom: 50px;
}

/* 4. 每个作品集行 */
.portfolio-row {
    margin: 60px 0;
}

/* 5. 居中标题 */
.section-title {
    text-align: center;
    text-transform: uppercase;
    font-size: 2em;
    font-weight: bold;
    color: #FFD700; 
    margin-bottom: 30px;
}

/* 6. 图片流容器：实现左右可滚动 */
.image-stream {
    display: flex;
    overflow-x: auto; /* 关键：允许水平滚动 */
    padding: 0 50px 20px 50px; 
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
    -ms-overflow-style: none;
    
    /* ***** 关键修改：使图片流居中 ***** */
    justify-content: center; /* 在内容不足以滚动时居中 */
    /* 添加一个内层 div 来实现真正的居中滚动 */
    /* 或者使用 padding-left 和 padding-right 结合 transform */
    /* 更简单的居中方案是让内部元素足够多，或者使用 grid */
    /* 对于 flexbox 滚动，justify-content: center 只在内容不够铺满时有效 */
    /* 为了视觉居中，我们用一个技巧：使用内边距结合负 margin */
    margin-left: auto;
    margin-right: auto;
    width: fit-content; /* 让滚动条只出现在内容区域 */
    max-width: calc(100% - 100px); /* 留出 50px 边距 */
}
/* 解决 `justify-content: center` 和 `overflow-x: auto` 的矛盾：
   flex 容器居中后，如果内容超出了，滚动条会在中间。
   更常见和美观的做法是容器本身不居中，而是内容左对齐滚动。
   如果一定要**视觉上居中**，通常是在 image-stream 内部再嵌套一个 flex 容器来居中。
   但为了代码简洁，我们保持 flex 容器本身的滚动性，并确保内容足够多时可以滚动。 */
.image-stream::before,
.image-stream::after {
    content: '';
    flex-shrink: 0;
    width: 50px; /* 两侧留出空白 */
}


/* 7. 单个图片项目样式 */
.portfolio-item {
    flex-shrink: 0; 
    margin-right: 20px;
    transition: transform 0.3s ease;
    border: 3px solid #FF1493; /* 边框改为粉色 */
    line-height: 0; 
}

.portfolio-item:hover {
    transform: translateY(-5px); 
    border-color: #1E90FF; /* 悬停时边框变蓝色 */
}

.portfolio-item img {
    height: 300px; 
    width: auto;
    display: block;
    object-fit: cover; 
}
