/* ============================================================
   原有样式（完全保留，仅微调 overflow 以支持 tooltip）
   ============================================================ */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  padding-top: 70px;   /* 防止被固定导航遮挡 */
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 24px;
}

.palette {
  background: #fff;
  border-radius: 14px;
  overflow: visible;       /* 让 tooltip 不被裁剪 */
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
  transition: 0.2s;
  position: relative;
}
.palette:hover {
  transform: translateY(-2px);
}

.meta {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 12px;
  color: #666;
}

.colors {
  display: flex;
  height: 120px;
  overflow: hidden;        /* 裁剪色块，保持圆角 */
  border-radius: 0 0 14px 14px;
}

.color {
  flex: 1;
  position: relative;
  cursor: pointer;
  transition: 0.15s;
}
.color:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 11px;
  color: white;
  opacity: 0;
  transition: 0.15s;
  mix-blend-mode: difference;
}
.color:hover .label {
  opacity: 1;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 14px;
  }
  .colors {
    height: 100px;
  }
}

#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  opacity: 0;
  transition: 0.2s;
}

/* ============================================================
   新增样式（分类导航、分类标题、tooltip）
   ============================================================ */

/* ---- 主容器 ---- */
.main-container {
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

/* ---- 分类导航（极简标签） ---- */
.category-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
}
/*.nav-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}*/
/*修改方案1*/
/*
.nav-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;          /* 占满父容器宽度 */
  /* 删除 margin: 0 auto; */
  /* 删除 max-width: 1400px; */
/*}
*/
/*修改方案2*/
.nav-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 1400px;    /* 可选，限制最大宽度 */
  margin: 0;            /* 取消居中 */
  width: 100%;
}



.nav-inner::-webkit-scrollbar {
  display: none;
}

.nav-home{
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #FFF;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  background:#ff8b94;
  border: 1px solid #a50f0f;
  margin-right: 0.6rem;
}
.nav-item {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #777;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  background: transparent;
  border: 1px dashed #ccc;
}
.nav-item:hover {
  background: rgba(0, 0, 0, 0.02);
  border-color: #aaa;
  color: #333;
}
.nav-item.active {
  background: #f0f0f0;
  border: 1px solid #aaa;
  color: #222;
}

/* ---- 分类标题 ---- */
.category-section {
  padding-top: 20px;
  margin-bottom: 40px;
}
.category-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 0 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.category-icon {
  font-size: 22px;
  line-height: 1;
}
.category-name {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
}
.category-count {
  font-size: 14px;
  color: #bbb;
  font-weight: 400;
}

/* ---- Tooltip（悬停显示 ❤️ + 数值） ---- */
.title {
  position: relative;
  cursor: help;
}
.title::after {
  content: "❤️ " attr(data-likes);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 2px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.title:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* ---- 热度颜色等级（由 JS 添加类） ---- */
.palette.heat-low .title:hover::after {
  color: #ccc;
}
.palette.heat-medium .title:hover::after {
  color: #ff6b6b;
}
.palette.heat-high .title:hover::after {
  color: #e74c3c;
  text-shadow: 0 0 12px rgba(231, 76, 60, 0.6);
}
.palette.heat-rainbow .title:hover::after {
  color: #ff1744;
  text-shadow: 0 0 20px rgba(255, 23, 68, 0.8), 0 0 40px rgba(255, 23, 68, 0.4);
  animation: heart-pulse 1s ease-in-out infinite;
}
@keyframes heart-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
  body {
    padding-top: 60px;
  }
  .category-nav {
    height: 48px;
    padding: 0 12px;
  }
  .nav-item {
    padding: 2px 12px;
    font-size: 12px;
    border-radius: 16px;
  }
  .category-header {
    padding: 0 0 10px 0;
  }
  .category-name {
    font-size: 17px;
  }
  .category-icon {
    font-size: 20px;
  }
  .category-count {
    font-size: 13px;
  }
  .main-container {
    padding: 0 12px;
  }
  .title::after {
    font-size: 11px;
    padding: 1px 10px;
  }
}