/* 广告包装器样式 */
.ad-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.ad-wrapper {
    font-family: Arial, sans-serif;
    margin: 20px 0;
    overflow: hidden; /* 防止溢出影响外部布局 */
}
.ad-container {
    max-width: 100%; /* 防止过宽影响整体布局 */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}
.ad-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    break-inside: avoid; /* 防止跨列显示 */
}
.ad-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
.ad-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}
.ad-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}
.ad-title {
    text-align: center;
    width: 100%;
    padding: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 直播模块样式 */
.live-module .video-container {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}
.live-module .col-25 {
    padding: 0 10px;
    box-sizing: border-box;
    margin-bottom: 20px;
}
/* 平板及PC端：一行4列 */
@media (min-width: 769px) {
    .live-module .col-25 {
        width: 25%;
    }
}
/* 手机端：一行2列 */
@media (max-width: 768px) {
    .live-module .col-25 {
        width: 50%;
    }
}
/* 卡片样式 */
.live-module .video-elem {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    height: 100%;
}
.live-module .video-elem:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.25);
    transform: translateY(-8px);
}
.live-module .img {
    background-size: cover;
    background-position: center;
    height: 0;
    padding-bottom: 75%;
    transition: transform 0.5s ease;
}
.live-module .video-elem:hover .img {
    transform: scale(1.08);
}
.live-module .ad-layer {
    font-size: 0.9em;
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.live-module .video-container {
    position: static !important;
    height: auto !important;
    padding-bottom: 0 !important;
    overflow: visible !important;
}

/* 漂浮广告样式 */
.float-ad-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
}
.float-ad-container.left {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}
.float-ad-container.right {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}
.float-ad-container.active {
    opacity: 1;
    visibility: visible;
}
/* 单个广告样式 */
.float-ad-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.float-ad-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.float-ad-image {
    display: block;
    width: 120px;
    height: auto;
}
/* 关闭按钮样式 */
.float-ad-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: #ff4b2b;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    z-index: 10;
    font-family: "Arial", sans-serif;
    transition: all 0.2s ease;
}
.float-ad-close:hover {
    background-color: #ff6b47;
    transform: scale(1.1);
}

/* 弹窗广告样式 */
.ad-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    background: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
}
.ad-popup.active {
    opacity: 1;
    visibility: visible;
}
.ad-content {
    position: relative;
    background: none;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* 优化阴影效果 */
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.ad-popup.active .ad-content {
    transform: scale(1);
}
.ad-link {
    display: block;
}
.ad-image {
    display: block;
    border-radius: 0; /* 取消边框圆角 */
    box-shadow: none; /* 取消图片阴影 */
    max-width: 90%; /* 最大宽度限制为窗口的90%，避免超大图片溢出 */
    max-height: 90vh; /* 最大高度限制为窗口高度的90% */
}
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}
.close-btn:hover {
    transform: scale(1.1);
}

/* 横幅广告样式 */
.banner-ad {
  width: 100%;
  overflow: hidden;
  margin-bottom: 20px; /* 可选：底部边距 */
}
.banner-link {
  display: block;
  width: 100%;
  text-decoration: none;
}
.banner-image {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100%;
  border: none;
}

/* 响应式调整 - 适配不同屏幕尺寸 */
@media (max-width: 768px) {
    .ad-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    .ad-title {
        font-size: 12px;
    }
    .float-ad-container {
        width: 80px;
    }
    .float-ad-image {
        width: 80px;
    }
    .float-ad-close {
        width: 20px;
        height: 20px;
        font-size: 12px;
        top: 3px;
        right: 3px;
    }
}
@media (max-width: 480px) {
    .ad-container {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }
    .ad-item {
        padding: 8px;
    }
    .ad-title {
        font-size: 11px;
    }
}

.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}