/* CSS效果手机 */
/*全局去除默认样式*/
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* 移动端布局 */
@media only screen and (max-width: 768px) {

  /* 让body可以滚动 */
  body {
    overflow-y: auto;
    height: 100%;
  }

  /* 修改大背景样式，让它作为滚动容器 */
  .大背景 {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    position: relative;
    padding: 20px 0 80px;
    overflow-x: hidden;
    /* 移除overflow-x: hidden，或改为auto */
    overflow-y: visible;
    /* 允许垂直滚动 */
  }

  /* 创建一个包含田字格和按钮组的内容容器 */
  .内容容器 {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    flex: 1;
    /* 占据可用空间 */
    /* 确保这个容器可以正常滚动 */
    overflow-y: visible;
    top: -10%;
  }

  .页面顶部 {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    text-align: center;
    color: white;
    font-size: 18px;
    width: 100%;
    padding: 20px 15px 10px;
    margin-bottom: 10px;
    animation: 放大 2s ease-in-out forwards;
  }

  @keyframes 放大 {
    0% {
      opacity: 0;
      transform: scale(0);
    }

    50% {
      opacity: 1;
      transform: scale(1.2);
    }

    100% {
      opacity: 1;
      transform: scale(1);
    }
  }

  .排序 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    width: auto;
    max-width: 700px;
    height: auto;
    /* 确保高度自适应 */
    min-height: 400px;
    margin: 0 auto;
    position: relative;
    /* 移除任何overflow设置 */
    overflow: visible;
    align-items: center;
  }

  .一个单元格 {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 200px;
    border-radius: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
  }

  .一个单元格:hover {
    transform: translateY(-5px);
  }

  .一个单元格 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .一个单元格 .标题 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .一个单元格 .标题:hover {
    color: skyblue;
    background-color: rgba(0, 0, 0, 0.9);
  }

  /* 按钮组样式修改 - 作为内容容器的一部分 */
  .按钮小队 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 15px;
    max-width: 700px;
    margin: 30px auto 0;
    padding: 0px 58px;
    position: relative;
    top: 12%;
    bottom: auto;
  }

   button {
    width: 100%;
    max-width: 550px;
    height: 55px;
    margin: 0;
    padding: 12px 20px;
    background: #007bff;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-align: center;
  }

   button:hover {
    background-color: #0056b3;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  }

   button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  .音乐按钮 {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  .音乐按钮:hover {
    transform: scale(1.1);
  }

  .音乐按钮 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 15px;
  }

  @keyframes rotate {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
  }

  /* 音乐播放时旋转 */
  #music:not([paused])+.音乐按钮 img {
    animation: rotate 2s linear infinite;
  }

  audio {
    display: none;
  }

  .大背景::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url(../图片/地球背景.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(70%);
    z-index: -1;
  }
}