* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Poppins', 'Noto Sans SC', sans-serif;
  background: #f5f7fa;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
}
body.dark {
  background: #1e1e2f;
  color: #ddd;
}

header {
  text-align: center;
  margin-bottom: 20px;
}
header h1 {
  font-size: 2.5rem;
  background: linear-gradient(270deg, #4facfe, #00f2fe, #a18cd1, #fbc2eb);
  background-size: 600% 600%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease infinite;
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
header h2 {
  font-size: 1rem;
  color: #666;
  margin-top: 6px;
}
body.dark header h2 {
  color: #aaa;
}

.main-container {
  width: 100%;
  max-width: 100%;
  margin-bottom: 8px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
#main-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  transition: transform 0.3s ease;
  cursor: zoom-in;
}
#main-image.zoomed {
  transform: scale(2);
  cursor: zoom-out;
}

.cache-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.cache-bar span {
  font-size: 0.9rem;
}
.btn.small {
  padding: 4px 8px;
  font-size: 0.8rem;
  background: #ff7979;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.download-tip {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 10px;
}
body.dark .download-tip {
  color: #aaa;
}

.thumbs-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 5px;
  scrollbar-width: none;
}
.thumbs-container::-webkit-scrollbar {
  display: none;
}
.thumbs-container img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: border .2s;
  border: 2px solid transparent;
}
.thumbs-container img.active {
  border-color: #4facfe;
}

.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.btn {
  padding: 10px 20px;
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  background: #4facfe;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:focus {
  outline: none;
}

.info-bottom {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.info-bottom strong {
  color: #000;
}
body.dark .info-bottom strong {
  color: #4facfe;
}

footer {
  font-size: 0.8rem;
  color: #888;
}
body.dark footer {
  color: #666;
}

/* 移动端优化 */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.8rem;
  }
  header h2 {
    font-size: 0.9rem;
  }
  .btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
  .thumbs-container img {
    width: 80px;
    height: 50px;
  }
  .info-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .cache-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
