/* ========================================
   广告样式 - 完全仿原站布局
   ======================================== */

/* 1. 最顶部横幅广告 - 居中有边距 */
.ads-top-banner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  background: #000;
}

.ads-top-banner a {
  display: block;
}

.ads-top-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* 2. 顶部体育导航栏 - 黑色背景 */
.ads-app-nav {
  background: #000;
  padding: 10px 0;
}

.app-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.app-nav-logo img {
  height: 45px;
  width: auto;
}

.app-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.app-nav-links a {
  display: block;
}

.app-nav-links a img {
  height: 40px;
  width: auto;
  transition: transform 0.3s;
}

.app-nav-links a:hover img {
  transform: scale(1.05);
}

/* 3. 多条横幅广告 - 居中有边距 */
.ads-banners {
  background: #000;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.ads-banner-item {
  display: block;
  width: 100%;
}

.ads-banner-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* 4. APP图标导航 - 黑色背景 */
.ads-app-icons {
  background: #000;
  padding: 20px 0;
}

.app-icons-grid {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.app-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.3s;
  width: 100px;
}

.app-icon-item:hover {
  transform: translateY(-3px);
}

.app-icon-item img {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  object-fit: cover;
}

.app-icon-item span {
  font-size: 13px;
  color: #fff;
  text-align: center;
}

/* 5. 文字广告链接表格 - 严格按原站颜色 */
.ads-text-links {
  background: #000;
  padding: 0;
}

.text-links-table {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  border-collapse: collapse;
  table-layout: fixed;
}

.text-links-table td {
  padding: 12px 15px;
  text-align: center;
  border: 1px solid #222;
}

.text-links-table a {
  color: #000;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: block;
}

/* 原站颜色 - 第1列黄色，第2列粉色，第3列黄色，第4列青色 */
.text-links-table td:nth-child(1) {
  background: #ffd700;
}

.text-links-table td:nth-child(2) {
  background: #ff69b4;
}

.text-links-table td:nth-child(3) {
  background: #ffd700;
}

.text-links-table td:nth-child(4) {
  background: #00ced1;
}

.text-links-table td a {
  color: #000;
}

/* 6. 右侧悬浮广告 - APP图标风格 */
.ads-right-float {
  position: fixed;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ads-right-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: transform 0.3s;
}

.ads-right-item:hover {
  transform: translateY(-3px);
}

.ads-right-item img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.ads-right-item span {
  font-size: 11px;
  color: #fff;
  text-align: center;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 7. 弹窗广告 */
.ads-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.ads-popup {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.ads-popup-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 4px;
}

.ads-popup-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 30px;
  height: 30px;
  background: #ff4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.ads-popup-close:hover {
  background: #ff0000;
}

/* 8. 侧边栏广告位 */
.ad-slot {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.ad-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-label {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 6px;
  font-size: 10px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: 4px;
}

/* 响应式 */
@media (max-width: 1400px) {
  .ads-right-float {
    right: 2px;
  }
  .ads-right-item {
    width: 70px;
  }
}

@media (max-width: 1200px) {
  .ads-right-float {
    right: 5px;
  }
  .ads-right-item img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
  }
  .ads-right-item span {
    font-size: 10px;
    max-width: 55px;
  }
}

@media (max-width: 768px) {
  .ads-right-float {
    right: 3px;
    gap: 6px;
  }
  .ads-right-item img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
  }
  .ads-right-item span {
    font-size: 9px;
    max-width: 50px;
  }
}

@media (max-width: 479px) {
  .ads-right-float {
    right: 2px;
    gap: 5px;
  }
  .ads-right-item img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }
  .ads-right-item span {
    display: none;
  }
}

@media (max-width: 991px) {
  /* 横幅广告优化 */
  .ads-banners {
    padding: 0 10px;
  }

  .ads-banner-item {
    margin-bottom: 2px;
  }

  .ads-banner-item img {
    height: auto;
    max-height: 60px;
    object-fit: cover;
  }
}

@media (max-width: 768px) {
  .app-nav-links {
    display: none;
  }

  /* APP图标网格 */
  .ads-app-icons {
    padding: 12px 0;
  }

  .app-icons-grid {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 0 10px 8px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .app-icons-grid::-webkit-scrollbar {
    display: none;
  }

  .app-icon-item {
    flex-shrink: 0;
    width: 70px;
  }

  .app-icon-item img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
  }

  .app-icon-item span {
    font-size: 11px;
  }

  /* 文字链接表格 */
  .ads-text-links {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .text-links-table {
    font-size: 11px;
    min-width: 320px;
  }

  .text-links-table td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  .text-links-table a {
    font-size: 11px;
  }

  /* 横幅广告 */
  .ads-banners {
    padding: 0 8px;
  }

  .ads-banner-item img {
    max-height: 50px;
  }
}

@media (max-width: 479px) {
  /* 更小屏幕的横幅广告 */
  .ads-banners {
    padding: 0 5px;
  }

  .ads-banner-item img {
    max-height: 40px;
  }

  /* APP图标 */
  .ads-app-icons {
    padding: 8px 0;
  }

  .app-icons-grid {
    gap: 6px;
    padding: 0 8px 6px;
  }

  .app-icon-item {
    width: 60px;
  }

  .app-icon-item img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }

  .app-icon-item span {
    font-size: 10px;
  }

  /* 文字链接 */
  .text-links-table td {
    padding: 6px 4px;
  }

  .text-links-table a {
    font-size: 10px;
  }

  /* 弹窗广告 */
  .ads-popup {
    max-width: 95%;
  }

  .ads-popup-content img {
    max-height: 70vh;
  }

  .ads-popup-close {
    width: 26px;
    height: 26px;
    font-size: 16px;
    top: -8px;
    right: -8px;
  }
}

/* 强制右侧悬浮广告在所有屏幕尺寸下显示 */
.ads-right-float {
  display: flex !important;
}

@media (max-width: 768px) {
  .ads-right-float {
    right: 5px;
    top: 80px;
    transform: none;
    gap: 12px;
  }
  .ads-right-float .ads-right-item img {
    width: 55px;
    height: 55px;
  }
  .ads-right-float .ads-right-item span {
    display: none;
  }
}

@media (max-width: 479px) {
  .ads-right-float {
    right: 3px;
    top: 60px;
    gap: 10px;
  }
  .ads-right-float .ads-right-item img {
    width: 50px;
    height: 50px;
  }
  .ads-right-float .ads-right-item span {
    display: none;
  }
}
