/* 主题变量：支持 prefers-color-scheme 自动切换，且在 JS 中可通过设置 data-theme 切换 */
:root {
  --page-bg: #fafafa;
  --header-bg: #fff;
  --header-bg-gradient: linear-gradient(90deg, #ffffff 0%, #f6f6f6 100%);
  --header-border: #eaeaea;
  --card-bg: #fff;
  --surface: #fff;
  --surface-alt: #f5f7fa;
  --surface-border: #e5e5e5;
  --card-text: #222;
  --muted: #666;
  --muted-2: #888;
  --tag-bg: #f2f2f2;
  --icon-comment: #8f8f8f;
  --placeholder: #999;
  --skeleton-1: #efefef;
  --skeleton-2: #f7f7f7;
  --shadow: rgba(0, 0, 0, 0.06);
  --shadow-strong: rgba(0, 0, 0, 0.12);
  --refresh-bg: #fff;
  --search-bg: #fff;
  --hover-bg: rgba(0, 0, 0, 0.06);
  --icon-color: #333;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page-bg: #0b0d10;
    --header-bg: #0f1113;
    --header-bg-gradient: linear-gradient(90deg, #0f1113 0%, #121418 100%);
    --header-border: rgba(255, 255, 255, 0.04);
    --card-bg: #0f1316;
    --surface: #101316;
    --surface-alt: #14171c;
    --surface-border: rgba(255, 255, 255, 0.08);
    --card-text: #e6eef8;
    --muted: #9aa3ad;
    --muted-2: #7f8c94;
    --tag-bg: #13181b;
    --placeholder: #9aa3ad;
    --icon-comment: #7f8a95;
    --skeleton-1: #111316;
    --skeleton-2: #0f1316;
    --shadow: rgba(0, 0, 0, 0.6);
    --shadow-strong: rgba(0, 0, 0, 0.5);
    --search-bg: #000;
    --hover-bg: rgba(255, 255, 255, 0.08);
    --refresh-bg: var(--search-bg);
    --icon-color: #fff;
    --tag-bg: #1a1f23;
  }
}


/* 允许通过 data-theme="dark" 强制切换（可选） */
.icon {
  color: var(--icon-color);
}

/* 容器 */
.masonry-wrap {
  width: 100%;
  max-width: 1400px;
  margin: auto;
  margin-top: 62px;
  padding: 8px;
  box-sizing: border-box;
}

/* 列容器（每列单独渲染） */
.masonry-cols {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.masonry-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 卡片 */
.card {
  background: var(--card-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 3px var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, opacity .28s ease;
  transform-origin: center center;
}

/* .card:active {
    box-shadow: 0 6px 20px var(--shadow-strong);
  } */


.card .img-wrap {
  width: 100%;
  background: var(--tag-bg);
  position: relative;
  overflow: hidden;
}

.card .img-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  /* 中心裁剪 */
  object-position: center center;
  transition: opacity .28s ease;
}

.card .body {
  padding: 10px 12px 14px;
}

.card .title {
  font-size: 15px;
  color: var(--card-text);
  line-height: 1.35;
  margin-bottom: 8px;
  font-weight: bold;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

.card .tags {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.card .tag {
  background: var(--tag-bg);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card .tag .tag-icon,
.card .tag i {
  color: #ff5722;
  font-size: 12px;
}

.stat-icon {
  color: var(--icon-comment);
  font-size: 12px;
}

.stats {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat-item {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 2px 2px;
}

/* 广告标签样式 */
.card .tag.ad-tag {
  background: #fff2e8;
  color: #d14b34;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 12px;
  /* font-weight: 600; */
}

.card .img-wrap {
    position: relative;
    overflow: hidden;
}

.card .type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 12px;
    border-radius: 20px;
    background: #ffffff;
    color: #f57c00;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 2;
    letter-spacing: 0.5px;
}

/* 不同颜色可选，但按需求是橙色字体 */
.card .type-badge {
    color: #e65100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
}

/* 占位（Skeleton）风格，参考小红书 */
.skeleton {
  background: linear-gradient(90deg, var(--skeleton-1) 25%, var(--skeleton-2) 37%, var(--skeleton-1) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

.skeleton .title {
  height: 14px;
  margin: 12px;
  border-radius: 6px;
}

/* 卡片进入动画 */
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px) scale(0.995); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card.animate-in {
  animation: card-in .36s cubic-bezier(.2,.8,.2,1) both;
}

/* 悬停微交互：上升并放大 */
.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 28px var(--shadow-strong);
}

/* 响应式：PC 5 列，手机 2 列（列宽由 JS 按需创建） */
@media (min-width: 1100px) {
  .masonry-wrap {
    padding: 14px;
  }
}

/* 小间距时去掉滚动条占位 */
body {
  background: var(--page-bg);
}

/* 加载提示 */
.loading-more {
  text-align: center;
  padding: 16px;
  color: var(--muted-2);
  margin-top: 20px;
}

.header {
  width: 100%;
  margin: 0 auto;
  height: 60px;
  line-height: 60px;
  box-sizing: border-box;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: fixed;
  overflow: hidden;
  z-index: 1000;
  top: 0;
  background: var(--header-bg-gradient);
}
.header-title{
  display: flex;
  font-size: 25px;
  font-weight: bold;
  padding: 0px 10px;
  color: var(--card-text);
}

.header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  /* max-width: 1400px; */
  padding: 0 10px;
  box-sizing: border-box;
  /* height: 60px; */
  margin: auto;
}

.category-tabs {
  width: 100%;
  max-width: 1400px;
  margin: auto;
  box-sizing: border-box;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 10px 10px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  align-items: center;
  justify-content: flex-start;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.tab-btn {
  flex: 0 0 60px;
  width: 60px;
  height: 32px;
  line-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--card-text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-btn.active {
  background: #ff5722;
  color: #fff;
  border-color: #ff5722;
}

.tab-btn:hover {
  background: var(--hover-bg);
}

.header-search input.inline-search-input {
  border: none;
  background: none;
  color: var(--card-text);
}

.header_logo {
  height: 60px;
  width: auto;
  margin-right: 12px;

}

/* header 内的搜索入口 */
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--search-bg);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 20px;
  cursor: pointer;
  width: 100%;
  border: 1px solid var(--surface-border);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  /* min-width: 220px;*/
  max-width: 420px; 
  box-sizing: border-box;
  height: 40px;
  margin-bottom: 10px;
  /* margin-top: 5px; */
}

.header-search i {
  font-size: 14px;
}

.header-search .placeholder {
  color: var(--placeholder);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



/* PC 模式下把搜索框居中，图标放到右侧作为按钮 */
@media (min-width: 800px) {
  
  .header-search {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 680px;
    width: 50%;
    top: 10px;
  }

  .header-search.editing {
    /* 保持与未编辑时相同的背景色调 */
    background: var(--search-bg);
  }

  .header-search.focused,
  .header-search:focus-within,
  .header-search:active {
    border-color: #ff5722;
    box-shadow: 0 0 0 6px rgba(255, 87, 34, 0.12);
  }

  .header-search input.inline-search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 8px 12px;
    border-radius: 20px;
    transition: box-shadow .18s ease, transform .12s ease;
  }

  .header-search .search-btn {
    margin-left: 8px;
    color: var(--icon-color);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .12s cubic-bezier(.2, .8, .2, 1), box-shadow .12s ease;
  }

  .header-search .search-btn i {
    color: var(--icon-color);
  }

  /* 焦点样式（输入或点击时微动画） */
  .header-search.focused {
    box-shadow: var(--header-focus-shadow, 0 8px 24px rgba(14, 30, 37, 0.08));
  }

  .header-search .inline-search-input:focus {
    /* 保持输入框在 focused 时不发生位移或背景改变（只影响 input，不影响父容器） */
    transform: none;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
  }

  .header-search .search-btn.btn-press {
    transform: scale(0.92);
    /* box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12); */
  }
}

.search-btn {
  display: none;
}

.header-search .inline-search-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--card-text);
}

.inline-search-input {
  width: 100%;
}

/* 刷新按钮 */
.refresh-btn {
  position: fixed;
  right: 18px;
  bottom: 88px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--refresh-bg);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.12);
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1200;
}

.service-btn {
  position: fixed;
  right: 18px;
  bottom: 158px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--refresh-bg);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.12);
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1200;
}

.refresh-btn i,
.service-btn i {
  color: var(--icon-color);
  font-size: 18px;
}

.refresh-btn:hover,
.service-btn:hover {
  opacity: 1;
}

.spin {
  animation: spin 0.5s linear;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}