* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow: hidden;
}

/* 默认背景，如果 JS 成功加载缓存的壁纸会覆盖下面的伪元素样式 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://cdn.jsdelivr.net/gh/WangNingkai/BingImageApi@latest/images/latest.png') no-repeat center center/cover;
  z-index: -2;
  will-change: background;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: -1;
}

.center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 4rem;
  font-weight: bold;
  text-align: center;
  line-height: 1.3;
  transition: opacity 0.6s ease;
  max-width: 1800px;
  width: 80%;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.poem-meta {
  font-size: 1.2rem;
  text-align: right;
  margin-top: 0.8rem;
  opacity: 0.85;
}

@media (max-width: 900px) {
  .center-text {
    font-size: 2.2rem;
  }

  .poem-meta {
    font-size: 0.9rem;
  }
}

/* 顶部栏容器 */
.top-bar {
  position: absolute;
  top: 20px;
  right: 20px;
  left: 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0;
  z-index: 10;
}

/* 图标滚动外层容器：定位滑动提示的参考框 */
.icon-scroll-container {
  position: relative;
  flex-shrink: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

/* 图标可滑动区域 */
.icon-scroll-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  width: 100%;
  /* 隐藏滚动条 */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.icon-scroll-wrapper::-webkit-scrollbar {
  display: none;
}

/* 图标轨道 */
.icon-scroll-track {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 右侧固定区域：语言选择 + 地球图标 */
.top-right-fixed {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 4px;
}

/* 滑动提示箭头：绝对定位在 container 两端，不受 wrapper overflow 裁剪 */
.scroll-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.scroll-hint-left {
  left: 0;
  border-radius: 0 4px 4px 0;
}

.scroll-hint-right {
  right: 0;
  border-radius: 4px 0 0 4px;
}

/* 显示滑动提示时的动画 */
.scroll-hint.visible {
  opacity: 1;
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

/* 移动端适配 */
@media (max-width: 600px) {
  .top-bar {
    left: 1px;
    right: 10px;
    top: 12px;
  }

  .icon-scroll-container {
    max-width: calc(100vw - 148px);
    border-radius: 10px;
  }
}

.earth-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  animation: breathe 3s ease-in-out infinite;
}

.github-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
}

.github-icon:hover {
  animation: breathe-hover 1.5s ease-in-out infinite;
}

.top-right-link {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
}

.top-right-link:hover {
  animation: breathe-hover 1.5s ease-in-out infinite;
}

.earth-icon:hover {
  animation: breathe-hover 1.5s ease-in-out infinite;
}

@keyframes breathe {

  0%,
  100% {
    transform: scale(1.0);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes breathe-hover {

  0%,
  100% {
    transform: scale(1.0);
  }

  50% {
    transform: scale(1.12);
  }
}

.language-selector {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  font-size: 0.9rem;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.language-selector option {
  color: black;
}

footer {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 100%;
  text-align: right;
  color: #ccc;
  font-size: 0.9rem;
}

footer a {
  color: #ccc;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}