/* 1. 基础 reset */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
}

/* 2. 全屏背景 */
.bg-slider {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background: center/cover no-repeat;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.bg-slide.active { 
  opacity: 1;
}

/* 3. 毛玻璃表单容器 */
.form-wrapper {
  width: 90%;
  max-width: 420px;
  margin: 10vh auto;
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  color: #fff;
}

.form-wrapper h1 { 
  text-align: center; 
  margin-bottom: 24px; 
  font-weight: 500; 
}

/* 4. 表单元素 */
label {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
}

input {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 16px;
  transition: border 0.3s;
}

input:focus {
  outline: none;
  border-color: #fff;
}

button {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #0077ff;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover { 
  background: #005fd1; 
}

#msg { 
  margin-top: 12px; 
  text-align: center; 
  font-size: 14px; 
}

/* 5. 音乐按钮 */
#musicToggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 999;
  transition: background 0.3s;
}

#musicToggle:hover { 
  background: rgba(255, 255, 255, 0.4); 
}

/* 6. 音量控制 */
#volBox {
  position: fixed;
  bottom: 76px;
  right: 20px;
  width: 48px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  user-select: none;
  z-index: 999;
}

#volTrack {
  width: 4px;
  height: 80px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

#volBar {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #0077ff;
  border-radius: 2px;
  transition: height 0.1s;
}

#volText {
  color: #fff;
  font-size: 12px;
}

#volTrack:hover #volBar { 
  opacity: 0.8; 
}

/* 7. 复选框样式 */
.agree-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.agree-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid #fff;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  position: relative;
  transform: translateX(-2px) scale(0.9);
}

.agree-row input[type="checkbox"]:checked::before {
  content: '✓';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 10px;
  color: #fff;
  line-height: 14px;
  text-align: center;
}

/* 8. 物理画布 */
#physicsCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* 9. 底部信息 */
footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 48px; /* 最小高度确保有足够空间 */
  padding: 6px 12px; /* 左右添加内边距 */
  text-align: center;
  font-size: 11px; /* 稍微减小字体 */
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.4); /* 加深背景增加可读性 */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  box-sizing: border-box;
}

.footer-content {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.footer-tech {
  margin: 0;
  padding: 0 8px;
  white-space: nowrap; /* 防止文字换行 */
  overflow: hidden;
  text-overflow: ellipsis; /* 文字过长显示省略号 */
  max-width: 100%;
  box-sizing: border-box;
}

.footer-icp {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.3px;
  pointer-events: auto;
  padding: 1px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.footer-icp a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1); /* 添加轻微背景 */
  border: 1px solid rgba(255, 255, 255, 0.15); /* 添加边框 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
}

.footer-icp a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

/* 10. 响应式设计 */
@media (max-width: 480px) {
  .form-wrapper { 
    margin: 8vh auto; 
    padding: 30px 20px; 
  }
  
  footer {
    padding: 6px 10px;
    min-height: 44px;
  }
  
  .footer-tech {
    font-size: 10px;
    white-space: normal; /* 在小屏幕上允许换行 */
    line-height: 1.3;
    padding: 0 4px;
  }
  
  .footer-icp {
    font-size: 9px;
    margin-top: 1px;
  }
  
  .footer-icp a {
    padding: 2px 8px;
    min-height: 18px;
    font-size: 9px;
  }
  
  /* 调整音乐按钮位置避免重叠 */
  #musicToggle {
    bottom: 52px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  #volBox {
    bottom: 102px;
    width: 36px;
    height: 80px;
  }
  
  #volTrack {
    width: 3px;
    height: 60px;
  }
  
  #volText {
    font-size: 10px;
  }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
  .footer-tech {
    font-size: 9.5px;
    line-height: 1.2;
  }
  
  .footer-icp a {
    padding: 1px 6px;
    font-size: 8.5px;
  }
  
  #musicToggle {
    bottom: 48px;
    width: 36px;
    height: 36px;
    right: 15px;
  }
  
  #volBox {
    bottom: 94px;
    right: 15px;
  }
}

/* 平板设备优化 */
@media (min-width: 481px) and (max-width: 768px) {
  footer {
    padding: 8px 15px;
  }
  
  .footer-tech {
    font-size: 11px;
  }
  
  .footer-icp {
    font-size: 10px;
  }
}