body {
    margin: 0;
    padding: 0;
    width: 100%;
    background: #FFFFFF;
    font-family: 'Microsoft JhengHei UI', sans-serif;
}


.main {
    position: relative;
    width: 100%;
    padding-bottom: 60px;
}


#works-title {
    position: relative;
    width: 100%;
    height: 100px;
    background: #044799;
    display: flex;
    justify-content: center;
    align-items: center;
}

#works-title h1 {
    font-family: 'Microsoft JhengHei UI';
    font-style: normal;
    font-weight: 700;
    font-size: 36px;
    line-height: 46px;
    letter-spacing: 0.6em;
    color: #FFFFFF;
    text-align: center;
}


.categories-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 84.25px;
    margin-top: 40px;
}

.categories {
    display: flex;
    flex-direction: row;
    width: 1200px;
    height: 84.25px;
    gap: 2.05px;
}

.category {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 238.36px;
    height: 84.25px;
    background: #D9D9D9;
    text-decoration: none;
}

.category span {
    font-family: 'Microsoft JhengHei UI';
    font-style: normal;
    font-weight: 400;
    font-size: 28.7671px;
    line-height: 278%;
    text-align: center;
    color: #000000;
}

.category.active {
    background: #044799;
}

.category.active span {
    color: #FFFFFF;
}


.works-grid {
    display: none;
    margin-top: 40px;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    box-sizing: border-box;
}

.works-grid.active {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    justify-content: center;
    align-items: start;
}

.work-item {
    position: relative;
    width: 380px;
    height: 380px;
    margin-bottom: 0;
}

.work-placeholder {
    width: 380px;
    height: 380px;
    background: #D9D9D9;
    position: relative;
}

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

.work-placeholder video.work-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.video-overlay:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.video-overlay.playing {
    background-color: transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

/* 播放按钮 */
.play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 30px;
    border-color: transparent transparent transparent #ffffff;
}

.work-info {
    position: absolute;
    width: 380px;
    height: 64.44px;
    left: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.student-grade {
    font-family: 'Microsoft JhengHei UI';
    font-style: normal;
    font-weight: 400;
    font-size: 24px;
    line-height: 278%;
    color: #FFFFFF;
    margin-left: 15px;
}

.student-name {
    font-family: 'Microsoft JhengHei UI';
    font-style: normal;
    font-weight: 400;
    font-size: 24px;
    line-height: 278%;
    color: #FFFFFF;
    margin-right: 15px;
}

.work-name {
    font-family: 'Microsoft JhengHei UI';
    font-style: normal;
    font-weight: 400;
    font-size: 24px;
    line-height: 278%;
    color: #FFFFFF;
    margin-right: 15px;
    text-align: right;
    margin-left: auto;
}


@media screen and (max-width: 1800px) {
    .works-grid {
        max-width: 1200px;
        padding: 0;
    }
}

@media screen and (max-width: 1600px) {
    .works-grid {
        max-width: 1200px;
        padding: 0;
    }
    
    .works-grid.active {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        align-items: start;
    }
    
    .work-item, .work-placeholder, .work-info {
        width: 100%;
    }
    
    .work-item {
        height: 360px;
    }
    
    .work-placeholder {
        height: 360px;
    }
}

@media screen and (max-width: 1400px) {
    .works-grid {
        max-width: 1200px;
        padding: 0;
    }
    
    .works-grid.active {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        align-items: start;
    }
    
    .work-item, .work-placeholder, .work-info {
        width: 100%;
    }
    
    .work-item {
        height: 340px;
    }
    
    .work-placeholder {
        height: 340px;
    }
}

@media screen and (max-width: 768px) {
    #works-title {
        height: 60px;
    }
    
    #works-title h1 {
        font-size: 20px;
        letter-spacing: 0.3em;
    }
    
    .categories-container {
        height: auto;
        margin-top: 20px;
    }
    
    .categories {
        flex-direction: column;
        width: 90%;
        height: auto;
        gap: 5px;
        box-sizing: border-box;
    }
    
    .category {
        width: 100%;
        height: 40px;
        padding: 0;
    }
    
    .category span {
        font-size: 16px;
        line-height: 40px;
    }
    
    .works-grid {
        max-width: 90%;
        padding: 0;
        margin-top: 20px;
        box-sizing: border-box;
    }
    
    .works-grid.active {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .work-item {
        width: 100%;
        height: auto;
        margin-bottom: 0;
    }
    
    .work-placeholder {
        width: 100%;
        height: 0;
        padding-bottom: 100%;
        position: relative;
    }
    
    .work-placeholder img.work-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    .work-placeholder video.work-video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    .video-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    .play-icon {
        border-width: 15px 0 15px 30px;
    }
    
    .work-info {
        width: 100%;
        height: 40px;
        padding: 0 10px;
        box-sizing: border-box;
    }
    
    .student-grade, .student-name, .work-name {
        font-size: 14px;
        margin: 0;
        line-height: 40px;
    }
    
    h2 {
        width: 90%;
        margin: 20px auto;
        font-size: 16px;
    }
}

@media screen and (max-width: 375px) {
    #works-title h1 {
        font-size: 18px;
        letter-spacing: 0.2em;
    }
    
    .category span {
        font-size: 14px;
    }
    
    .student-grade, .student-name, .work-name {
        font-size: 12px;
    }
}
