/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #000000;
    padding-top: 60px; /* 确保body顶部有间距，避免导航栏遮挡内容 */
    min-height: 100vh; /* 确保body有最小高度 */
    overflow-x: hidden; /* 防止水平滚动 */
    overflow-y: auto; /* 允许纵向滚动 */
    position: relative; /* 为固定定位元素提供参考 */
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px 0;
    z-index: 100;
    top: 0;
}

.navbar ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

.navbar ul li {
    margin: 0 20px;
}

.navbar ul li a {
    text-decoration: none;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    transition: color 0.3s ease;
  }

.navbar ul li a:hover {
    color: #ff9900;
}

/* Main Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-auto-rows: minmax(20px, 6fr);
    gap: -40px;
    padding: 5px;
    max-width: 2000px;
    margin: 0 auto;
    width: 100%;
    min-height: calc(80vh + 600px); /* 确保内容足够长以产生滚动 */
    margin-top: 50px; /* 给grid-container加上margin-top，避免被固定的导航栏遮挡 */
    margin-bottom: 60px; /* 添加底部边距 */
    overflow: auto; /* 允许内容滚动 */
}

/* Grid Items - Exact sizes from the image */
.grid-item {
    background-color: rgba(255, 255, 255, 0.171);
    border-radius: 2px;
    box-shadow: 0 2px 5px rgba(226, 226, 226, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    animation: bounce 1.5s infinite ease-in-out;
    transition: transform 0.3s;
}

.grid-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Item-specific grid positioning */
.item-1 { grid-column: 1 / span 2; grid-row: 1; height: 300px; }
.item-2 { grid-column: 3 / span 2; grid-row: 1; height: 500px; }
.item-3 { grid-column: 5 / span 2; grid-row: 1; height: 300px; }
.item-4 { grid-column: 5/ span 2; grid-row: 2 / span 3; height: 300px; }
.item-5 { grid-column: 1 / span 2; grid-row: 2; height: 300px; }
.item-10 { grid-column: 7/ span 4; grid-row: 1; height: 250px; }





/* Content styling */
.item-number {
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 12px;
    color: #666;
}

.item-image {
    width: 300px;;
    height: 400px;;
    object-fit: cover;
    margin-bottom: 1px;
}

.item-title {
    font-size: 14px;
    text-align: end;
    font-weight: bold;
    padding: 0 5px;
}

/* Bounce animation */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Animation delays for wave effect */
.item-1 { animation-delay: 0s; }
.item-2 { animation-delay: 0.1s; }
.item-3 { animation-delay: 0.2s; }
.item-4 { animation-delay: 0.3s; }
.item-5 { animation-delay: 0.4s; }
.item-6 { animation-delay: 0.5s; }
.item-7 { animation-delay: 0.6s; }
.item-8 { animation-delay: 0.7s; }
.item-9 { animation-delay: 0.8s; }


/* 修改.active样式 - 居中放大 */
.grid-item.active {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(2) !important;
    z-index: 1000;
    box-shadow: 0 0 40px rgba(255,255,255,0.6);
    animation: none;
    width: auto !important;
    height: auto !important;
    max-width: 80vw;
    max-height: 80vh;
}

/* 新增：放大时图片尺寸调整 */
.grid-item.active .item-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.navbar-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 101;
    filter: invert(1);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.navbar-icon.playing {
    opacity: 1;
}

/* 在现有CSS中添加以下代码 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top::after {
    content: "↑";
    color: white;
    font-size: 24px;
}

