/* 基本样式 */
body { 
  font-family: Arial, sans-serif;
  background: url('../image/a1.jpg') no-repeat center center fixed;
  background-size: cover;
  margin: 0;
  color: #fff;
  position: relative;
  overflow: hidden; /* 禁用滚动条 */
  display: flex;
  flex-direction: column;  /* 确保内容垂直排列 */
  justify-content: center;
  align-items: center;
  height: 100vh; /* 使页面充满整个视口 */
}

/* 遮罩层 */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 1); /* 黑色透明背景 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* 保证遮罩在最上层 */
  opacity: 1;
  transition: opacity 1s ease-out; /* 渐变消失效果 */
}

/* 加载动画：类似Windows的几个点 */
#loader {
  display: flex;
  gap: 5px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #fff;
  animation: bounce 1.5s infinite ease-in-out;
}

.dot:nth-child(1) {
  animation-delay: 0s;
}

.dot:nth-child(2) {
  animation-delay: 0.3s;
}

.dot:nth-child(3) {
  animation-delay: 0.6s;
}

/* 动画：点的上下跳动效果 */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* 主页和登录按钮 */
.top-buttons {
  position: absolute;
  top: 10px;
  width: 100%;
  display: flex;
  justify-content: space-between; /* 左右两侧按钮 */
  padding: 0 30px;
  z-index: 10;
}

.button {
  padding: 10px 20px;
  background-color: rgba(0, 0, 0, 0.2); /* 淡化背景色，增加透明度 */
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s, transform 0.3s;
  margin: 0 10px;
}

.button:hover {
  background-color: rgba(0, 0, 0, 0.4);
  transform: translateY(-3px);
}

.button:active {
  transform: translateY(2px);
}

.homepage {
  background-color: rgba(76, 175, 80, 0.4);
}

.login {
  background-color: rgba(33, 150, 243, 0.4);
}

/* 主要内容布局 */
.container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  width: 100%;
  padding: 20px;
  background: rgba(0, 0, 0, 0.0); /* 半透明背景 */
  border-radius: 10px;
  margin-top: 30px; /* 让内容下移，避免和标题重叠 */
  box-sizing: border-box; /* 确保间距计算正确 */
}

/* 卡片样式 */
.box {
  background-color: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  font-size: 16px;
  color: #333;
  border: 2px solid #ddd;
}

.box:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.box:active {
  transform: translateY(2px);
}

/* 为不同功能添加不同的颜色 */
.box.info {
  background-color: #f0f8ff; /* 信息公示 */
}

.box.todo {
  background-color: #ffebcd; /* 待办清单 */
}

.box.search {
  background-color: #fffacd; /* 聚合搜索 */
}

.box.ai {
  background-color: #e0ffff; /* 人工智能 */
}

.box.weather {
  background-color: #f0fff0; /* 今日天气 */
}

.box.media {
  background-color: #f5f5dc; /* 影音天地 */
}

.box.news {
  background-color: #ffe4e1; /* 新闻资讯 */
}

.box.more {
  background-color: #fafad2; /* 更多功能 */
}

/* a标签样式 */
.box a {
  text-decoration: none;
  color: inherit;
  font-weight: bold;
}

/* 内容居中 */
.box h3 {
  margin: 0;
}

.box span {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: #777;
}

/* 媒体查询：适应小屏幕设备 */
@media screen and (max-width: 768px) {
  h1 {
    font-size: 24px;
    top: 10px;
  }

  .container {
    grid-template-columns: repeat(2, 1fr); /* 两列布局 */
    padding: 15px;
  }

  .box {
    font-size: 14px;
    padding: 15px;
  }

  .box h3 {
    font-size: 18px;
  }

  .box span {
    font-size: 12px;
  }
}

/* 媒体查询：适应超小屏幕设备（如手机） */
@media screen and (max-width: 480px) {
  h1 {
    font-size: 20px;
    top: 5px;
  }

  .container {
    grid-template-columns: 1fr; /* 单列布局 */
    gap: 10px;
    padding: 10px;
  }

  .box {
    font-size: 12px;
    padding: 12px;
  }

  .box h3 {
    font-size: 16px;
  }

  .box span {
    font-size: 10px;
  }
}
