/* css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    color: #fff;
    font-family: 'Arial', sans-serif;
    overflow-x: hidden;
}

#stars {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 20px;
}

.header-img {
    display: block;
    margin: 20px auto;
    max-width: 80%;
    border-radius: 8px;
}

.header-img-animated {
    animation: animatedEffect 3s infinite ease-in-out;
}

@keyframes animatedEffect {
    0% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(1.2) translateY(-20px);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

.enter-container {
    display: flex;
    flex-direction: column; 
    gap: 10px; 
    width: 100%;
}

.enter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px;
    background: transparent;
    border-radius: 8px;
}

.row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1; 
    gap: 10px;
    width: 100%;
}

.row-bottom {
    flex-shrink: 0;
    text-align: right;
}

.country {
    width: 30px; 
    height: 30px;
    flex-shrink: 0;
}

.country-name {
    flex: 1; 
    text-align: left;
    font-weight: bold;
    font-size: 16px;
    color: #fff;
}

.speed {
    width: 60px;
    height: 30px;
    flex-shrink: 0;
}

.number {
    width: 50px;
    text-align: center;
    font-weight: bold;
    color: #00ff00;
}

.enter {
    margin-left: auto;
}

.enter img {
    width: 100px;
    height: auto;
}


.ads {
    display: flex; /* 使用 Flexbox 布局 */
    flex-direction: column; /* 子元素垂直排列 */
    align-items: center; /* 水平居中对齐子元素 */
    gap: 10px; /* 子元素之间的间距 */
    width: 100%; /* 容器宽度占满父元素 */
    padding: 20px 0; /* 上下内边距 */
}

/* 单个广告项样式 */
.ad-item {
    position: relative; /* 让子元素定位相对于父元素 */
    border-radius: 12px; /* 圆角效果 */
    overflow: hidden; /* 保证圆角裁剪效果 */
    transition: transform 0.3s; /* 添加平滑过渡效果 */
    width: 100%; /* 在较大屏幕上宽度为 100% */
    max-width: 800px; /* 设置更大的最大宽度限制 */
}

/* 图片自适应规则 */
.ad-img {
    display: block; /* 图片作为块级元素显示，避免默认行内显示的空白 */
    width: 100%; /* 图片宽度占满父容器 */
    height: auto; /* 保持图片原始比例 */
    object-fit: cover; /* 保证图片覆盖容器同时保持图片比例 */
    min-height: 100px; /* 设置图片的最小高度，避免图片过小 */
    border-radius: 12px; /* 保持图片圆角与父容器一致 */
}

.ad-img {
    animation: float 3s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

footer {
    background-color: transparent; 
    color: white;
    text-align: center;
    padding: 10px 0;
    position: relative;
    bottom: 0;
    width: 100%;
  }

  footer p {
    margin: 0;
    font-size: 14px;
  }
  
/* 电脑端样式修正 */
@media (min-width: 769px) {
  .enter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px; /* 控制列间距 */
    flex-wrap: nowrap; /* 禁止换行 */
    width: 100%;
  }

  /* 四个等宽列 */
  .row-top {
    flex: 1;  /* 关键设置 */
    min-width: 25%; /* 最小保证四列布局 */
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .speed-container,
  .number-container,
  .row-bottom {
    flex: 1;
    min-width: 25%;
    display: flex;
    justify-content: center;
  }

  /* 按钮特殊处理 */
  .row-bottom {
    justify-content: flex-end;
  }

  /* 元素尺寸控制 */
  .country {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
  }

  .country-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 769px) {
  .ads {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    width: 100%;
    padding: 40px 0;
  }

  .ad-item {
    position: relative;
    transition: transform 0.3s;
  }

  .ad-item:hover {
    transform: translateY(-5px);
  }
}

@media (min-width: 768px) {
    .ad-item {
        width: 100%; /* 在平板和更大屏幕上设置更大的宽度 */
    }
}

@media (min-width: 1024px) {
    .ad-item {
        width: 100%; /* 在桌面端设置更大的宽度 */
    }
}