* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0d1117;
  color: #e6edf3;
}

/* ── 顶部区域 ── */
.char {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 20px;
}

.logo {
  font-size: 32px;
  font-weight: 800;
  color: #58a6ff;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

/* ── 模式标签 ── */
.mode-tabs {
  display: flex;
  gap: 0;
  border: 1px solid #30363d;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}

.mode-tab {
  padding: 7px 22px;
  background: #0d1117;
  border: none;
  color: #8b949e;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: 0.15s;
  border-right: 1px solid #30363d;
}
.mode-tab:last-child { border-right: none; }
.mode-tab:hover { color: #c9d1d9; background: #161b22; }

.mode-tab.active {
  background: #1f6feb;
  color: #fff;
  font-weight: 600;
}
.mode-tab.active:hover { background: #388bfd; }

/* ── 搜索框 ── */
.search-wrap {
  width: 100%;
  max-width: 560px;
}

.search-input {
  width: 100%;
  padding: 10px 20px;
  border: 1px solid #30363d;
  border-radius: 24px;
  background: #161b22;
  color: #e6edf3;
  font-size: 15px;
  outline: none;
  font-family: inherit;
}
.search-input:focus { border-color: #58a6ff; box-shadow: 0 0 0 3px rgba(88,166,255,0.15); }
.search-input::placeholder { color: #6e7681; }

/* ── 内容区 ── */
.content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 8px 24px 40px;
}

/* ── 图片网格 ── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.image-card {
  border-radius: 12px;
  overflow: hidden;
  background: #161b22;
  border: 1px solid #21262d;
  cursor: pointer;
  transition: 0.2s;
}
.image-card:hover {
  transform: translateY(-2px);
  border-color: #1f6feb;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.image-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.card-body {
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.card-tag {
  padding: 2px 8px;
  background: #1c2333;
  border: 1px solid #21262d;
  border-radius: 4px;
  font-size: 11px;
  color: #8b949e;
}

/* ── 占位提示 ── */
.placeholder {
  text-align: center;
  padding: 100px 20px;
  color: #484f58;
  font-size: 18px;
}
.placeholder p { margin-bottom: 8px; }

/* ── 空/加载 ── */
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: #6e7681;
  grid-column: 1 / -1;
}

.spinner {
  text-align: center;
  padding: 60px 20px;
  color: #6e7681;
  grid-column: 1 / -1;
}
.spinner::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  margin: 0 auto 12px;
  border: 3px solid #30363d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 灯箱 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}

.modal-container {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 12px;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #0d1117;
  color: #8b949e;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: #1e2638; color: #e6edf3; }

.modal-image {
  max-width: 95vw;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px;
  border-top: 1px solid #30363d;
  background: #1c2333;
}

.download-btn {
  padding: 8px 20px;
  background: #1f6feb;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.download-btn:hover { background: #58a6ff; }

/* ── 音乐列表 ── */
.music-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.music-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  transition: 0.15s;
}
.music-card:hover { border-color: #30363d; }

.music-card-info {
  flex: 1;
  min-width: 0;
}

.music-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #e6edf3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.music-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.mu-btn {
  padding: 5px 10px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  color: #c9d1d9;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}
.mu-btn:hover { background: #1c2333; border-color: #58a6ff; }

.mu-btn-dl { padding: 5px 8px; min-width: 30px; justify-content: center; }

.mu-icon { font-size: 10px; }

/* ── 背景音乐按钮 ── */
.bgm-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  width: 36px;
  height: 36px;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #161b22;
  color: #c9d1d9;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}
.bgm-btn:hover { background: #1c2333; border-color: #58a6ff; }
.bgm-btn.muted { color: #6e7681; }

.gh-btn {
  position: fixed;
  top: 16px;
  right: 60px;
  z-index: 999;
  width: 36px;
  height: 36px;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #161b22;
  color: #c9d1d9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}
.gh-btn:hover { background: #1c2333; border-color: #58a6ff; color: #fff; }

@media (max-width: 768px) {
  .char { padding: 32px 16px 16px; }
  .logo { font-size: 24px; }
  .mode-tab { padding: 6px 14px; font-size: 13px; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
  .content { padding: 8px 12px 24px; }
}
