/* ============================================================================
   探索页 · 小红书风格瀑布流（2026-10-21 改版）
   ----------------------------------------------------------------------------
   要点（对着小红书实际形态抄的）：
     · 双列瀑布流，卡片高度随封面比例自然变化（不是等高网格）
     · 封面圆角 12px、无边框、靠底色分层
     · 标题两行截断，字号 13px、行高 1.42，颜色比正文深
     · 底部一行：作者头像 20px + 昵称（灰）+ 点赞数（右对齐）
     · 手机端仍是双列（小红书手机上也是两列），间距收窄
   ============================================================================ */

/* ---- 顶部搜索条：圆角胶囊，去掉「搜索」按钮（回车即搜） ---- */
.xhs-search{
  position:relative;
  display:flex;align-items:center;
  margin:0 0 14px;
  background:var(--bg-hover);
  border:1px solid transparent;
  border-radius:999px;
  padding:0 14px;
  height:40px;
  transition:border-color .15s,background .15s;
}
.xhs-search:focus-within{
  border-color:var(--accent);
  background:var(--bg-elev);
}
.xhs-search .sicon{
  display:inline-flex;align-items:center;justify-content:center;
  color:var(--text-mute);margin-right:9px;flex:0 0 auto;
}
.xhs-search input{
  flex:1;min-width:0;
  border:0;background:none;outline:none;
  font-size:14px;color:var(--text);
  font-family:inherit;
}
.xhs-search input::placeholder{color:var(--text-mute)}
.xhs-clear{
  width:22px;height:22px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--bg-elev);color:var(--text-mute);
  font-size:11px;text-decoration:none;flex:0 0 auto;
}
.xhs-clear:hover{color:var(--text)}

/* ---- 推荐 / 精选 切换 ---- */
.xhs-tabs{
  display:flex;gap:20px;
  margin:0 0 14px;
  padding:0 2px;
}
.xhs-tab{
  position:relative;
  font-size:15px;font-weight:600;
  color:var(--text-mute);
  text-decoration:none;
  padding:0 0 8px;
  transition:color .15s;
}
.xhs-tab:hover{color:var(--text-dim)}
.xhs-tab.on{color:var(--text);font-weight:800}
.xhs-tab.on::after{
  content:"";
  position:absolute;left:50%;bottom:0;
  transform:translateX(-50%);
  width:20px;height:3px;border-radius:2px;
  background:var(--accent);
}

.xhs-count{
  font-size:12.5px;color:var(--text-mute);
  margin:0 0 12px;
}

/* ---- 瀑布流：CSS columns 让卡片高度自然错落 ----
   gap 用 10px（小红书两列间距很紧）；卡片 break-inside:avoid 防被切断 */
.xhs-grid{
  column-count:2;
  column-gap:10px;
  margin-bottom:18px;
}
@media (min-width:1100px){
  /* 中栏够宽时给三列，图多的站更耐看 */
  .xhs-grid{column-count:3}
}
@media (max-width:520px){
  .xhs-grid{column-gap:8px}
}

.xhs-card{
  display:block;
  break-inside:avoid;
  -webkit-column-break-inside:avoid;
  margin:0 0 10px;
  border-radius:12px;
  overflow:hidden;
  background:var(--bg-elev);
  text-decoration:none;
  color:inherit;
  transition:transform .16s cubic-bezier(.2,.9,.28,1),box-shadow .16s;
  will-change:transform;
}
.xhs-card:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 18px rgba(0,0,0,.14);
}
.xhs-card:active{transform:scale(.985)}

/* 封面：不写死宽高比，让图片自己撑开 → 瀑布流才有错落感 */
.xhs-cover{
  position:relative;
  display:block;
  background:var(--bg-hover);
  line-height:0;
}
.xhs-cover img{
  display:block;
  width:100%;
  height:auto;
  object-fit:cover;
}
.xhs-noimg{
  display:flex;align-items:center;justify-content:center;
  aspect-ratio:4/5;
  color:var(--text-mute);
}

/* 角标：多图数 / 视频播放 */
.xhs-nimg,
.xhs-play{
  position:absolute;
  right:7px;top:7px;
  display:inline-flex;align-items:center;gap:3px;
  font-size:10.5px;line-height:1;
  padding:3px 6px;
  border-radius:5px;
  background:rgba(0,0,0,.5);
  color:#fff;
  backdrop-filter:blur(3px);
}
.xhs-play svg{width:11px;height:11px}

.xhs-body{padding:8px 9px 9px}

.xhs-title{
  font-size:13px;
  line-height:1.42;
  font-weight:600;
  color:var(--text);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  word-break:break-word;
}

.xhs-meta{
  display:flex;align-items:center;gap:5px;
  margin-top:8px;
  font-size:11.5px;
  color:var(--text-mute);
}
/* 卡片里的小头像：覆盖默认 40px */
.xhs-meta .avatar{
  width:20px;height:20px;
  font-size:9.5px;
  flex:0 0 auto;
}
.xhs-nick{
  flex:1;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.xhs-like{
  display:inline-flex;align-items:center;gap:2.5px;
  flex:0 0 auto;
}
.xhs-like svg{width:12px;height:12px}
.xhs-like b{font-weight:600;font-variant-numeric:tabular-nums}

/* 浅色主题下阴影淡一点，深色主题下更明显 */
:root[data-theme="light"] .xhs-card:hover{
  box-shadow:0 4px 14px rgba(20,20,30,.10);
}

/* 手机端：探索页不要右栏，靠底部导航切换 */
@media (max-width:820px){
  .xhs-tabs{gap:18px}
  .xhs-title{font-size:12.5px}
  .xhs-search{height:38px}

  /* 探索页在手机上要贴边铺满（小红书就是这么干的），
     所以把 main 的左右内边距收掉，改由各块自己控制 */
  body.page-explore .main{padding-left:0;padding-right:0}
  /* 顶部大标题在手机上多余 —— 小红书首页只有搜索框和分类 */
  body.page-explore .main .topbar h1{display:none}
  body.page-explore .main .topbar{
    padding:10px 12px 0;
    min-height:0;
  }
  .xhs-search{margin:2px 12px 10px}
  .xhs-tabs{padding:0 12px}
  .xhs-count{padding:0 12px}
  .xhs-grid{padding:0 12px}
  body.page-explore .main .empty{padding:40px 16px}
}

/* 桌面端也补一点内边距，别贴着中栏边缘 */
@media (min-width:821px){
  .xhs-search{margin-top:2px}
}
