/* 定义主题色 */
:root {
  --primary-color: #4CAF50;
  --accent-color: #ffffff;
  --background-color: rgba(0, 0, 0, 0.7);
  --shadow-color: rgba(0, 0, 0, 0.2);
}

body {
  background-image: url('background-image.webp');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 100vh;
  margin: 0;
  font-family: 'Arial', sans-serif;
  color: var(--accent-color);
  padding-top: 60px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: -1;
}

/* 头部横幅样式 */
.banner {
  width: 100%;
  padding: 15px 0;
  background: linear-gradient(45deg, var(--background-color), rgba(76,175,80,0.8));
  color: var(--accent-color);
  text-align: center;
  font-size: 18px;
  position: fixed;
  top: 0;
  z-index: 1000;
  white-space: nowrap;
  overflow: hidden;
}

.banner-text {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 30s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* 内容区域样式 */
#content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  animation: fadeIn 1s ease-out;
  width: 90%;
  max-width: 800px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* GIF 容器样式 */
#gif-container {
  width: 100%;
  max-width: 500px;
  height: auto;
  aspect-ratio: 16/9;
  border: 3px solid var(--accent-color);
  border-radius: 15px;
  box-shadow: 0 0 30px 15px rgba(76,175,80,0.3);
  margin-bottom: 30px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  animation: containerGlow 8s infinite alternate;
}

@keyframes containerGlow {
  0% { box-shadow: 0 0 30px 15px rgba(76,175,80,0.3); }
  33% { box-shadow: 0 0 30px 15px rgba(33,150,243,0.3); }
  66% { box-shadow: 0 0 30px 15px rgba(156,39,176,0.3); }
  100% { box-shadow: 0 0 30px 15px rgba(244,67,54,0.3); }
}

#gif-container:hover {
  transform: scale(1.03);
  box-shadow: 0 0 40px 20px rgba(76,175,80,0.5);
}

/* 加载动画 */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* GIF 图片样式 */
img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: opacity 0.5s ease;
}

/* 按钮容器样式 */
#gif-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  width: 100%;
  max-width: 500px;
}

/* 按钮样式 */
button {
  padding: 12px 25px;
  background: linear-gradient(45deg, #4CAF50, #2196F3);
  background-size: 200% 100%;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--shadow-color);
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: 0.5s;
}

button:hover {
  transform: translateY(-3px);
  background-position: right center;
}

button:hover::before {
  left: 100%;
}

/* 按钮内部图标样式 */
button svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

/* 标题样式 */
h1 {
  font-size: 3.5rem;
  text-align: center;
  margin-bottom: 30px;
  text-shadow: 3px 3px 6px var(--shadow-color);
  background: linear-gradient(45deg, #fff, #4CAF50, #2196F3, #9C27B0);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleGradient 8s linear infinite alternate;
}

@keyframes titleGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* 页脚样式 */
footer {
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: var(--accent-color);
  padding: 20px 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

footer a {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

footer a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* 媒体查询，适配小屏幕 */
@media (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
  }

  button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .banner {
    font-size: 16px;
  }
  
  #gif-container {
    aspect-ratio: 4/3;
  }
}