/* 加载动画 */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

#loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hero-section {
    background: url('../assets/hero-background.jpg') no-repeat center center/cover;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.hero-section .content {
    z-index: 1;
    position: relative;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    margin-top: 1rem;
    background-color: #ff6b6b;
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 50px;
    transition: background-color 0.3s ease-in-out;
}

.cta-button:hover {
    background-color: #ff4747;
}

#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    z-index: 999;
}

#navbar ul {
    list-style-type: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

#navbar a {
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease-in-out;
}

#navbar a:hover {
    color: #ff6b6b;
}

/* 作品展示网格 */
.filter-buttons {
    margin-bottom: 1rem;
    text-align: center;
}

.filter-buttons button {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    transition: background-color 0.3s ease-in-out;
}

.filter-buttons button.active,
.filter-buttons button:hover {
    background-color: #ff4747;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 5rem;
}

.grid-item {
    position: relative;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    /* 确保每个卡片都有固定的宽高 */
    width: 100%;
    height: 400px;
    /* 根据实际需求设定一个合适的固定高度 */
    will-change: transform, opacity;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 确保图片按照比例填充整个卡片 */
    transition: opacity 0.3s ease-in-out;
}

.grid-item:hover img {
    opacity: 0.7;
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.grid-item:hover .overlay {
    opacity: 1;
}

/* 时间轴视图 */
.timeline {
    list-style-type: none;
    padding: 0;
    position: relative;
    margin-top: 4rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background-color: #ddd;
    z-index: 1;
    /* 确保时间线在卡片之后 */
}

.timeline-item {
    padding: 1rem;
    position: relative;
    margin-bottom: 2rem;
    width: calc(50% - 2rem);
    /* 减去左右间距 */
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease-in-out;
    will-change: transform, opacity;
}

.timeline-item.left {
    float: left;
    clear: left;
}

.timeline-item.right {
    float: right;
    clear: right;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: #ff6b6b;
    border-radius: 50%;
    top: 20px;
    z-index: 2;
}

.timeline-item.left::after {
    left: calc(50% + 2rem);
}

.timeline-item.right::after {
    right: calc(50% + 2rem);
}

.timeline-content {
    max-width: 500px;
    padding: 1rem;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    position: relative;
    z-index: 2;
    /* 确保内容在时间线上方 */
}

.timeline-item.show {
    opacity: 1;
    transform: translateX(0);
}

.timeline h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* 错落有致的时间轴卡片 */
.timeline-item:nth-child(odd) .timeline-content {
    height: 200px;
    /* 可根据需要调整 */
}

.timeline-item:nth-child(even) .timeline-content {
    height: 250px;
    /* 可根据需要调整 */
}

/* 额外样式：渐变背景或边框 */
.timeline-item:nth-child(odd) .timeline-content {
    border-left: 4px solid #ff6b6b;
}

.timeline-item:nth-child(even) .timeline-content {
    border-right: 4px solid #ff6b6b;
}

.footer {
    clear: both;
    position: relative;
    background-color: #333;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    padding: 1rem;
}

#scroll-to-top {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

#scroll-to-top:hover {
    background-color: #ff4747;
}