body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

.bg-image {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    position: relative;
}

.navbar {
    width: 200px;  /* 减小宽度 */
    /* 修改背景颜色透明度为 70% */
    background-color: rgba(51, 51, 51, 0.7);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    text-align: center;  /* 添加文本居中 */
}

.nav-brand {
    color: white;
    padding: 20px;
    font-size: 1.5em;
    text-align: center;
    background-color: #222;
}

.nav-item {
    color: white;
    text-decoration: none;
    padding: 12px 15px;
    display: block;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background-color: #444;
    border-left: 4px solid #826692;
    transform: translateX(5px);
}



.nav-item:hover::after {
    transform: translateX(0);
}

.sub-nav {
    display: none;
    /* 修改背景颜色并设置 50% 透明度 */
    background-color: rgba(68, 68, 68, 0.5); 
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-10px);
}

.nav-item-container:hover .sub-nav {
    display: block;
    opacity: 0.5; /* 保持下拉导航栏透明度为 30% */
    transform: translateX(0);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sub-nav-item {
    color: #ddd;
    text-decoration: none;
    padding: 8px 20px;
    display: block;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.sub-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #555;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: -1;
}

.sub-nav-item:hover::before {
    transform: scaleX(1);
}
a:hover {
    text-decoration: none;
    color: rgb(255, 255, 255);
}

.sub-nav-item:hover {
    background-color: #555;
    color: #fff;
}

.nav-item-container:hover .sub-nav {
    display: block;
    opacity: 1;
    transform: translateX(0);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sub-nav-item {
    color: #ddd;
    text-decoration: none;
    padding: 8px 20px;
    display: block;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.sub-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #555;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: -1;
}

.sub-nav-item:hover::before {
    transform: scaleX(1);
}

.content {
    margin-left: 220px;
    padding: 20px;
    color: white; /* 字体颜色改为白色 */
    text-align: center; /* 文本居中 */
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white; /* 字体颜色改为白色 */
}

main {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 30px;
    border-radius: 10px;
    color: white; /* 字体颜色改为白色 */
    text-align: center; /* 文本居中 */
}

article, section {
    margin-bottom: 30px;
    color: white; /* 字体颜色改为白色 */
    text-align: center; /* 文本居中 */
}

h1, h2 {
    color: white; /* 字体颜色改为白色 */
    text-align: center; /* 文本居中 */
}

p {
    line-height: 1.6;
    color: white; /* 字体颜色改为白色 */
    text-align: center; /* 文本居中 */
}

.back-to-home {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 10px 20px;
    background-color: #747475;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    z-index: 1000; /* 确保按钮显示在其他元素之上 */
}

.back-to-home:hover {
    background-color: #4d4d4d;
}
body {
    display: flex; /* 使用flexbox布局 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    height: 100vh; /* 设置body高度为视口高度 */
    margin: 0; /* 去掉默认边距 */
    font-family: Arial, sans-serif;
    padding: 20px;
    }
    
    /* 清除之前的样式，重新设置按钮样式 */
    .button-container {
        position: fixed;
        top: 10px;
        left: 10px;
    }
    
    button {
        background-color: #1E90FF;
        color: white;
        border: none;
        padding: 8px 16px;
        margin-right: 5px;
        font-size: 14px;
        cursor: pointer;
    }
    
    /* 按钮样式完全匹配其他作业 */
    .back-home {
        position: fixed;
        top: 20px;
        left: 20px;
        padding: 15px 35px;
        background: linear-gradient(135deg, #6e8efb, #4a6cf7);
        border-radius: 10px;
        color: white;
        text-decoration: none;
        font-size: 18px;
        font-weight: 500;
        transition: all 0.3s ease;
        border: none;
        box-shadow: 0 4px 15px rgba(110, 142, 251, 0.4);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        cursor: pointer;
    }
    
    .back-home:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(110, 142, 251, 0.6);
        background: linear-gradient(135deg, #4a6cf7, #6e8efb);
    }
    
    .back-button {
        position: fixed;
        top: 80px;
        left: 20px;
        padding: 15px 35px;
        background: linear-gradient(135deg, #6e8efb, #4a6cf7);
        border-radius: 10px;
        color: white;
        text-decoration: none;
        font-size: 18px;
        font-weight: 500;
        transition: all 0.3s ease;
        border: none;
        box-shadow: 0 4px 15px rgba(110, 142, 251, 0.4);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        cursor: pointer;
    }
    
    .back-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(110, 142, 251, 0.6);
        background: linear-gradient(135deg, #4a6cf7, #6e8efb);
    }
    .product {
        position: relative;
        width: 300px;
        margin: 20px;
        display: inline-block;
    }
    
    .product-image {
        width: 100%;
        height: auto;
        display: block;
    }

/* 视频容器 */
.video-container {
    position: relative;
    width: 560px;
    height: 315px;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.video-container:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* 视频缩略图 */
.video-thumbnail {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.7s ease, filter 0.5s ease;
}

.video-container:hover .video-thumbnail {
    transform: scale(1.05);
    filter: brightness(0.85) saturate(1.1);
}

/* 遮罩层 - 新配色 */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: linear-gradient(to top,
    rgba(25, 35, 65, 0.85) 0%,
    rgba(25, 35, 65, 0.4) 60%,
    transparent 100%);
}

.video-container:hover .video-overlay {
    opacity: 1;
}

/* 文字内容 - 新配色 */
.video-title {
    text-align: center;
    color: #fff;
    transform: translateY(20px);
    transition: transform 0.5s ease;
    width: 100%;
}

.video-container:hover .video-title {
    transform: translateY(0);
}

.video-title h3 {
    font-size: 28px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #f8f9fa;
    letter-spacing: 0.5px;
}

.video-title p {
    font-size: 16px;
    margin: 0;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(248, 249, 250, 0.9);
    max-width: 80%;
    margin: 0 auto;
}

/* 播放按钮 - 新配色 */
.play-button-img {
    width: 70px;
    height: 70px;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s;
    cursor: pointer;
    margin-top: 25px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.video-container:hover .play-button-img {
    opacity: 0.95;
    transform: scale(1) translateY(0);
}

.play-button-img:hover {
    opacity: 1;
    transform: scale(1.1) translateY(0);
}

/* 响应式设计 */
@media (max-width: 600px) {
    .video-container {
        width: 90vw;
        height: calc(90vw * 9 / 16);
    }

    .video-title h3 {
        font-size: 22px;
    }

    .video-title p {
        font-size: 14px;
    }

    .play-button-img {
        width: 50px;
        height: 50px;
    }
}

.dice-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dice-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.die {
    width: 70px;
    height: 70px;
    background-color: #333;
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 8px;
    box-sizing: border-box;
    position: relative;
}

.dot {
    background-color: white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    justify-self: center;
    align-self: center;
    margin: 0;
    position: relative;
}

/* 只为6点骰子设置特殊样式 */
.die-6 {
    gap: 6px;
    padding: 10px;
}

.die-6 .dot {
    width: 9px;
    height: 9px;
}

/* 确保每个格子大小一致 */
.die > * {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}