/* =========================
   全局基础
========================= */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: #f6f6f6;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", sans-serif;
  color: #111;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* =========================
   Header（主页吸顶）
========================= */
#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 22px;
  gap: 16px;
  background-color: rgba(246,246,246,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  transition: padding 0.25s ease, box-shadow 0.25s ease;
}

#header.shrink {
  padding-top: 22px;
  padding-bottom: 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.site-title {
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 600;
  color: rgba(17,17,17,0.8);
  text-align: center;
  white-space: nowrap; 
  overflow: visible;
  font-family: -apple-system, "SF Pro Display", "PingFang SC", sans-serif;
}

#header.shrink .site-title {
  font-size: clamp(16px, 3.5vw, 26px);
}

/* 搜索框 */
#search {
  width: 100%;
  display: flex;
  justify-content: center;
}

#search input {
  width: 360px;
  max-width: 92%;
  height: 40px;
  padding: 0 14px;
  font-size: 16px;
  color: #111;
  background-color: #f6f6f6;
  border: 1px solid rgba(0,0,0,0.02);
  border-radius: 12px;
  outline: none;
}

#search input::placeholder {
  color: rgba(0,0,0,0.25);
}

/* =========================
   Section（主页结构）
========================= */
.section {
  max-width: 1200px;
  margin: 2px auto 14px; /* 板块间距进一步压缩 */
  padding: 18px; /* 保持内边距 */
  background-color: #f6f6f6;
  border-radius: 14px;
  position: relative;
}

/* =========================
   标题行
========================= */
.section-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 10px; /* 轻微压缩标题与标签间距 */
  margin-bottom: 4px; /* 再轻微压缩，板块内部更紧凑 */
  position: sticky;
  top: var(--section-sticky-top, 80px);
  background-color: #f6f6f6;
  z-index: 900;
  padding: 4px 0;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

/* =========================
   二级标题（分类）
========================= */
.section-subtitle {
  display: flex;
  align-items: center;
  gap: 8px; /* 分类标签横向间距进一步压缩 */
  font-size: clamp(12px, 2.5vw, 18px);
  font-weight: 500;
  color: rgba(17,17,17,0.95);
  margin: 0 0 2px 0; 
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: gap 0.2s ease;
}

.section-subtitle::-webkit-scrollbar {
  display: none;
}

.section-tags {
  display: flex;
  align-items: center;
  gap: 8px; /* 分类标签横向间距进一步压缩 */
  flex-shrink: 0;
}


.section-tags a {
  text-decoration: none;
  color: #111;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 8px;
  background-color: transparent;
  line-height: 1.2;
  flex-shrink: 0;
  transition: transform 0.15s ease;
  border: 1px solid rgba(0,0,0,0.025);
}

.section-tags a:hover {
  transform: translateY(-2px);
}

/* =========================
   品牌卡片（三列）
========================= */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px; /* 调整间距 */
  justify-items: center;
}

.brand-card {
  width: 100%;
  max-width: 330px;
  background-color: #f6f6f6;
  border-radius: 12px;
  padding: 12px; /* 压缩上下 padding */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.01);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.brand-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.brand-name {
  font-size: 16px;
  font-weight: 500;
  color: #111;
  text-align: center;
  line-height: 1.25;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================
   Utility
========================= */
.hidden {
  display: none !important;
}

/* =========================
   响应式优化
========================= */
@media (max-width: 1024px) {
  .section-subtitle { gap: 9px; }
  .brand-grid { gap: 10px; }
  .brand-name { font-size: 15px; }
}

@media (max-width: 768px) {
  .section-subtitle { gap: 6px; }
  .brand-grid { gap: 10px; }
  .brand-name { font-size: 14px; }
}

@media (max-width: 480px) {
  .section-subtitle { gap: 4px; }
  .brand-grid { gap: 10px; }
  .brand-name { font-size: 13px; }
  #search input { width: 90%; }
}

/* 去除下划线 */
.brand-card,
.brand-card a,
.brand-name {
  text-decoration: none !important;
}
