/* CSS (styles.css) */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #000;
    color: #fff;
    overflow-x: hidden;
}

h1, h2, h3 {
    margin: 0;
    padding: 0;
}

.home {
    position: relative;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.background {
    position: absolute;
    inset: 0;
    background: url('images/project1.png') center/cover no-repeat;
    animation: backgroundSwitch 10s infinite alternate;
    z-index: -1;
}

@keyframes backgroundSwitch {
    0% { background-image: url('images/project1.png'); }
    20% { background-image: url('images/project2.png'); }
    40% { background-image: url('images/project3.png'); }
    60% { background-image: url('images/project4.png'); }
    80% { background-image: url('images/project5.png'); }
    100% { background-image: url('images/project1.png'); }
}

.name {
    font-size: 4rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7);
}

.nav {
    position: absolute;
    top: 20px;
    right: 20px;
}

.nav a {
    margin: 0 10px;
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.nav a:hover {
    color: rgb(0, 0, 0);
}

.about {
    background: #fff;
    color: #000;
    height: 100vh; /* 改为固定高度，确保背景覆盖整个页面 */
    padding: 40px 20px;
    text-align: center;
    font-family: 'Lato', sans-serif;
    font-weight: 300;
}

.full-height {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100vh;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
}


.text {
    font-size: 0.8rem;
    margin-bottom: 20px;
    line-height: 0.6;
}

.text.spaced {
    margin-bottom: 50px; /* 增加额外的间距 */
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #ffffff;
    color: #000;
}

.works {
    display: grid;
    grid-template-columns: 0.5fr 3.5fr; /* 调整左侧栏宽度 */
    height: calc(100vh - 40px); /* 减去 footer 的高度 */
}

.sidebar {
    background: #ffffff;
    color: #fff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.sidebar a {
    display: block;
    color: #9a9c9b;
    text-decoration: none;
    font-size: 0.8rem;
    font-family: 'Lato', sans-serif;
    padding: 5px 0;
    transition: color 0.3s;
}

.sidebar a:hover {
    color: rgb(255, 255, 255);
}

.main-content {
    padding: 20px;
    overflow: hidden; /* 防止滚动条 */
}

.main-content {
    padding: 20px;
    overflow-y: auto;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    padding: 200px;
}

.image-grid img,
.work-image {
    position: absolute;
    width: 350px;
    height: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-grid img:hover,
.work-image:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 散乱图片布局 */
.image-grid img:nth-child(1),
.work-image:nth-child(1) {
    top: 50px;
    left: 260px;
}

.image-grid img:nth-child(2),
.work-image:nth-child(2) {
    top: 110px;
    left: 580px;
}

.image-grid img:nth-child(3) ,
.work-image:nth-child(3) {
    top: 450px;
    left: 630px;
}

.image-grid img:nth-child(4) ,
.work-image:nth-child(4) {
    top: 300px;
    left: 980px;
}

.image-grid img:nth-child(5) ,
.work-image:nth-child(5) {
    top: 400px;
    left: 230px;
}

.works-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%; /* 跨整个页面 */
    background-color: #ffffff; /* 可调整背景色 */
    text-align: center;
    padding: 10px;
    border-top: 1px solid #ffffff;
    font-size: 0.8rem;
    color: #a5a5a5;
    z-index: 100; /* 确保其在最前面 */
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #fff;
    color: #000;
    overflow: hidden;
}

.carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100vh; /* 图片垂直居中 */
    background: #fff; /* 背景为白色 */
    overflow: hidden; /* 隐藏多余部分 */
}

.carousel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%; /* 宽度占满屏幕 */
    height: 100%; /* 高度占满屏幕 */
    overflow: hidden; /* 隐藏溢出内容 */
    background-color: #fff; /* 白色背景 */
}


.slider-image {
    position: absolute;
    max-height: 60%; /* 图片高度占屏幕的60% */
    max-width: 60%; /* 图片宽度占屏幕的60% */
    object-fit: contain; /* 保持图片比例 */
    opacity: 0; /* 默认隐藏图片 */
    transition: opacity 0.5s ease; /* 平滑过渡 */
}

.slider-image.active {
    opacity: 1; /* 只显示当前活动图片 */
}


button.prev,
button.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    padding: 10px;
    border-radius: 50%;
}

button.prev {
    left: 20px;
}

button.next {
    right: 20px;
}

button.prev:hover,
button.next:hover {
    background: rgba(0, 0, 0, 0.8);
}
