* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", sans-serif;
}

body {
  background: #f5f7fa;
  color: #333;
}

/* 顶部导航 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 99;
}
.logo {
  font-size: 20px;
  font-weight: bold;
  color: #7B61FF;
}
.nav {
  font-size: 16px;
  color: #666;
}

/* 筛选栏 */
.filter {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  overflow-x: auto;
  background: white;
  margin-bottom: 10px;
}
.filter-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: #eee;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.3s;
}
.filter-btn.active {
  background: #7B61FF;
  color: white;
}

/* 瀑布流容器 */
.waterfall-container {
  padding: 0 20px 20px;
}
.waterfall-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .waterfall-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1200px) {
  .waterfall-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  cursor: pointer;
}
.card img {
  width: 100%;
  display: block;
  object-fit: cover;
}
.card-info {
  padding: 12px;
}
.card-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}
.card-tag {
  font-size: 12px;
  color: #999;
}

/* 加载更多 */
.load-more {
  text-align: center;
  padding: 20px;
  display: none;
}
.loader {
  width: 20px;
  height: 20px;
  border: 2px solid #7B61FF;
  border-top: transparent;
  border-radius: 50%;
  animation: rotate 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
}
@keyframes rotate {
  0%{transform: rotate(0);}
  100%{transform: rotate(360deg);}
}

/* 返回顶部 */
.back-top {
  position: fixed;
  bottom: 30px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #7B61FF;
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: none;
  z-index: 98;
}

/* 模态框预览 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 100;
  justify-content: center;
  align-items: center;
}
.modal-content {
  max-width: 90%;
  max-height: 90vh;
}
.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
}
