/* CSS变量定义 - 可在源码中调整 */
:root {
  /* 背景类型: 1=纯色, 2=渐变, 3=图片 */
  --background-type: 3;
  /* 纯色背景 */
  --solid-color: #282748;
  /* 渐变背景 */
  --gradient-start: #2c3e50;
  --gradient-end: #1a1a2e;
  /* 图片背景 */
  --bg-image-url: url('https://img.at13xe.top');
  /* 图片模糊度 */
  --image-blur: 0px;
  /* 毛玻璃效果参数 */
  --glass-bg-color: rgba(255, 255, 255, 0.1);
  /* 延迟测试时间 (毫秒) */
  --ping-timeout: 5000;
  /* 延迟阈值 (毫秒) */
  --low-latency-threshold: 100;
  /* 倒计时时间 (秒) */
  --countdown-time: 8;
}

/* 根据背景类型应用背景 */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Arial', sans-serif;
  overflow: auto; /* 允许滚动 */
  position: relative;
  /* 允许用户缩放 */
  -ms-touch-action: pan-y pinch-zoom;
  touch-action: pan-y pinch-zoom;
}

/* 随机背景图片容器 */
.bg-box {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2; /* 在其他内容后面 */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.bg-box.loaded {
  opacity: 1;
}

/* 纯色背景 */
body[data-bg-type="1"] {
  background-color: var(--solid-color);
}

/* 渐变背景 */
body[data-bg-type="2"] {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
}

/* 图片背景 */
body[data-bg-type="3"] {
  /* 不再使用CSS变量设置背景，而是通过JavaScript设置 */
  /* background: var(--bg-image-url) no-repeat center center fixed; */
  background-size: cover;
}

/* 图片背景的模糊效果 - 不再需要，因为bg-box元素会处理背景 */
/* body[data-bg-type="3"]::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  filter: blur(var(--image-blur));
  z-index: -1;
} */

/* 容器 - 居中显示 */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

/* 标题样式 */
.header {
  text-align: center;
  margin-bottom: 30px;
  color: white;
  z-index: 1;
}

#main-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#sub-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#content {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#content a {
  color: #4CAF50;
  text-decoration: none;
  cursor: pointer;
}

#content a:hover {
  text-decoration: underline;
}

/* 卡片容器 - 毛玻璃效果 */
.card-container {
  width: 80%;
  max-width: 800px;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  background-color: var(--glass-bg-color);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-sizing: border-box;
}

/* 卡片列表 */
#cards-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* 线路卡片样式 */
.line-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  background-color: var(--solid-color);
  opacity: 0.5;
  color: white;
  font-size: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

/* 线路卡片被点击或悬停时的放大效果 */
.line-card:hover,
.line-card.active {
  transform: scale(1.02);
  opacity: 0.8;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.line-card:active {
  transform: scale(1.03);
}

/* 延迟和指示器容器 */
.delay-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 延迟文本 */
.delay-text {
  font-weight: bold;
  min-width: 40px;
  text-align: right;
}

/* 状态指示器圆圈 */
.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ccc; /* 默认灰色 */
  transition: all 0.3s ease;
}

.status-indicator.low-latency {
  background-color: #4CAF50; /* 绿色 - 低延迟 */
}

.status-indicator.medium-latency {
  background-color: #FFC107; /* 黄色 - 中延迟 */
}

.status-indicator.high-latency {
  background-color: #F44336; /* 红色 - 高延迟或不通 */
}

/* 底部信息样式 */
.footer {
  width: 100%;
  text-align: center;
  color: white;
  font-size: 0.9rem;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  margin: 30px auto;
  padding: 10px 0;
  max-width: 800px; /* 与卡片容器宽度一致 */
}

.footer p {
  margin: 5px 0;
}

.footer a {
  color: #4CAF50;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .card-container {
    width: 95%;
    padding: 20px;
  }
  
  #main-title {
    font-size: 2rem;
  }
  
  #sub-title {
    font-size: 1.2rem;
  }
  
  #content {
    font-size: 1rem;
  }
  
  .line-card {
    padding: 12px 15px;
  }
  
  .footer {
    font-size: 0.8rem;
    margin: 20px auto;
  }
}