/* 加载遮罩层样式 */
.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/sport-bg.png');
    background-size: cover;
    background-position: left top;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

/* 加载图标 */
.loading-icon {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 进度条容器 */
.progress-container {
    width: 200px;
    height: 8px;
    background-color: #f3f3f3;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 15px;
}

/* 进度条 */
.progress-bar {
    height: 100%;
    background-color: #c87939;
    width: 0%;
    transition: width 0.1s ease;
}

/* 加载提示文字 */
.loading-text {
    color: #ffe7b4;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    font-family: "Ma Shan Zheng", "ZCOOL XiaoWei", "Noto Serif SC", "SimSun", serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

body {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed; /* 防止背景滚动 */
}
.camp-wrap {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-image: url('../images/select-camp-bg.jpg'); 
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.camp-btn {
    position: absolute;
    border: none;
    width: 20vw;
    height: 40vh;
    background-repeat: no-repeat;
    background-size: contain;
    cursor: pointer;
}
.selecttips {
  position: absolute;
  width: 40vw;
  height: 10vh;
  top: 80%;
  left: 30%;
  background-image: url('../images/xuanze.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center center;
}
.btn-nanhai { top: 30%; left: 15%; background-image: url('../images/btn-nanhai.png'); }
.btn-guilin { top: 30%; left: 40%;background-image: url('../images/btn-guilin.png'); }
.btn-xiangjun { top: 30%; left: 65%; background-image: url('../images/btn-xiangjun.png'); }

/* 鼠标悬停效果 - 按钮向上移动 */
.camp-btn:hover {
    border-radius: 15px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    /* box-shadow: 0 5px 15px rgba(255, 255, 0, 0.3); */
}

.modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1000;
  display: none;
}

.user-modal, .login-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 1001;
  padding: 32px 36px 24px 36px;
  min-width: 320px;
  display: none;
  max-height: 80vh; /* 添加最大高度限制 */
  overflow-y: auto; /* 添加滚动条 */
  -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
}
.select-inline {
  display: inline-flex;       /* 保持行内元素性质，可以并排 */
  flex-direction: row;
  align-items: center;        /* 垂直居中 */
  margin-right: 20px;         /* 两个间距 */
  white-space: nowrap;        /* 防止换行 */
  font-weight: normal;
}

.select-inline select {
  margin-left: 5px;           /* 文字和下拉框间距 */
  min-width: 100px;           /* 给select一个固定最小宽度，防止太小 */
}

.user-form, .login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: transparent;
  border-radius: 16px;
  padding: 0;
  margin-bottom: 0;
  font-size: 18px;
  color: #333;
  box-shadow: none;
  max-width: 350px;
  width: 100%;
}

.user-form label, .login-form label {
  font-weight: bold;
  color: #3a2c13;
  display: block;
  margin-bottom: 4px;
}

.user-form input,
.login-form input,
.user-form select {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  margin-top: 8px;
  background: rgba(255,255,255,0.7);
  font-size: 16px;
  outline: none;
  transition: box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.user-form input:focus,
.login-form input:focus,
.user-form select:focus {
  box-shadow: 0 0 0 2px #e6b85c;
}

#user-confirm,
#login-btn, 
#show-register-btn,
#register-confirm,
#register-cancel
 {
  margin-top: 10px;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #e6b85c 0%, #f7e7b4 100%);
  color: #3a2c13;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

#user-confirm:hover,
#login-btn:hover, 
#show-register-btn:hover,
#register-confirm:hover,
#register-cancel:hover {
  background: linear-gradient(90deg, #f7e7b4 0%, #e6b85c 100%);
}

#db-status {
  position: fixed; 
  bottom: 10px; 
  right: 10px; 
  padding: 10px; 
  border-radius: 5px; 
  font-size: 12px; 
  color: white; display: none !important;
}

.music-control {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(139, 90, 43, 0.7);
  color: gold;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
@media (max-height: 500px) and (orientation: landscape) {
  
  /* 确保背景从左上角开始显示且铺满视口 */
  .camp-wrap {
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: top left;
    background-repeat: no-repeat;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
  }
  
  .selecttips {
    width: 40vw;
    height: 20vh;
    top: 80%;
    left: 30%;
    background-image: url('../images/xuanze.png');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center center;
  }
  .user-form, .login-form {
    max-width: 100%;
  }

  /* 确保登录模态框在手机横屏时居中 */
  .user-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 70vw;
    max-width: 500px;
    max-height: 80vh;
    padding: 20px;
    box-sizing: border-box;
  }

  .login-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 70vw;
    max-width: 500px;
    max-height: 80vh;
    padding: 20px;
    box-sizing: border-box;
  }
}

/* 新增：针对移动端的响应式布局 */
@media (max-width: 768px) {
  .user-modal, .login-modal {
    width: 70vw;
    max-width: 400px; /* 限制最大宽度 */
    max-height: 90vh; /* 增加最大高度 */
    overflow-y: auto; /* 内容超出时启用垂直滚动 */
    padding: 16px;
    top: 5vh; /* 调整顶部位置，避免被状态栏遮挡 */
    transform: translateX(-50%); /* 只保留水平居中 */
    box-sizing: border-box; /* 确保padding包含在总尺寸内 */
  }

  .user-form, .login-form {
    font-size: 16px; /* 调整字体大小 */
    gap: 10px; /* 减少间距 */
    max-height: none; /* 移除高度限制 */
  }

  .user-form input,
  .login-form input,
  .user-form select {
    
    padding: 6px 10px; /* 减少内边距 */
    height: 35px;
  }

  .user-form label,
  .login-form label {
    font-size: 14px; /* 减小标签字体 */
    margin-bottom: 2px;
  }

  #user-confirm,
  #login-btn, 
  #show-register-btn,
  #register-confirm,
  #register-cancel {
    font-size: 16px;
    padding: 8px 0; /* 减少按钮内边距 */
    margin-top: 8px;
  }
  
  /* 确保select选项可见 */
  .select-inline {
    margin-right: 10px;
  }
  
  .select-inline select {
    min-width: 80px;
  }
}

/* 针对更小屏幕的优化 */
@media (max-width: 480px) {
  .user-modal, .login-modal {
    width: 95vw;
    max-height: 95vh;
    padding: 12px;
    top: 2.5vh;
  }

  .user-form, .login-form {
    gap: 8px;
  }

  .user-form input,
  .login-form input,
  .user-form select {
    font-size: 13px;
    padding: 5px 8px;
  }

  .user-form label,
  .login-form label {
    font-size: 13px;
  }

  #user-confirm,
  #login-btn, 
  #show-register-btn,
  #register-confirm,
  #register-cancel {
    font-size: 15px;
    padding: 6px 0;
  }
}
