body {
    margin: 0;
    padding: 20px;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.box {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    aspect-ratio: 1;
}

.box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 放大后的样式 */
.box.active {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 1000;
    width: 60vw;
    height: 60vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

/* 背景遮罩 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 999;
    display: none;
}

/* 音频播放器样式 */
.audio-player {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.7);
    padding: 15px;
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.box.active .audio-player {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}
.hover-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* 防止文字区域阻挡点击 */
}

.box:hover .hover-text {
    opacity: 1;
}