/**
 * 小红书风格 — 社区论坛 /explore
 * 参考 https://www.xiaohongshu.com/explore
 */
body.xhs-explore-body .bce-foot--minimal,
body.xhs-explore-body .cloud-footer {
  display: none !important;
}

/* 内容区已有独立搜索栏，避免与顶栏搜索重复 */
body.xhs-explore-body .bce-head-search-inline {
  display: none;
}

body.xhs-explore-body .bce-page--minimal {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.xhs-explore-body .bce-main-minimal {
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: #fff;
  flex: 1;
  min-height: 0;
  height: auto;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.xhs-app {
  --xhs-red: #ff2442;
  --xhs-bg: #fff;
  --xhs-text: #333;
  --xhs-muted: rgba(51, 51, 51, 0.6);
  --xhs-line: #f0f0f0;
  --xhs-rail-w: 220px;
  /* 仿小红书 PC：侧栏 + 内容区整体居中，内容栏最大约 1280px */
  --xhs-shell-max: 1680px;
  --xhs-detail-max: min(1380px, calc(100vw - var(--xhs-rail-w) - 24px));
  --xhs-content-col: min(1280px, 100%);
  --xhs-content-max: var(--xhs-content-col);
  --xhs-feed-w: var(--xhs-content-col);
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
  background: var(--xhs-bg);
  width: 100%;
  max-width: var(--xhs-shell-max);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  overflow: hidden;
}

/* ===== 左侧：仿小红书宽侧栏（图标左 + 文字右） ===== */
.xhs-rail {
  width: var(--xhs-rail-w);
  flex-shrink: 0;
  /* border-right: 1px solid var(--xhs-line); */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 16px 12px 20px;
  height: 100%;
  background: #fff;
  z-index: 30;
  box-sizing: border-box;
}

.xhs-rail-logo {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 18px;
  padding: 4px 8px 4px 12px;
  text-decoration: none !important;
  flex-shrink: 0;
  box-sizing: border-box;
}

.xhs-rail-logo img {
  width: auto;
  height: 32px;
  max-width: 40px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.xhs-rail-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--xhs-red);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.xhs-rail-logo-name {
  color: var(--xhs-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.xhs-rail-nav--top {
  padding-top: 8px;
}

.xhs-rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0 4px;
  scrollbar-width: none;
}

.xhs-rail-nav::-webkit-scrollbar {
  display: none;
}

.xhs-rail-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none !important;
  color: var(--xhs-muted);
  font-size: 16px;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s;
  box-sizing: border-box;
}

.xhs-rail-item:hover {
  background: #f8f8f8;
  color: var(--xhs-text);
}

.xhs-rail-item.is-active {
  color: var(--xhs-text);
  font-weight: 600;
  background: #f8f8f8;
}

.xhs-rail-foot {
  flex-shrink: 0;
  width: 100%;
  padding: 12px 8px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.xhs-rail-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--xhs-red);
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(255, 36, 66, 0.28);
  box-sizing: border-box;
}

.xhs-rail-login:hover {
  background: #e61f3a;
}

.xhs-rail-user {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none !important;
  color: var(--xhs-text);
  font-size: 14px;
  box-sizing: border-box;
}

.xhs-rail-user:hover {
  background: #f8f8f8;
}

.xhs-rail-user .xhs-avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
  flex-shrink: 0;
}

.xhs-rail-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.xhs-rail-ico {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 0;
  background: transparent center/24px no-repeat;
}

.xhs-rail-item.is-active .xhs-rail-ico {
  background-color: transparent;
}

.xhs-rail-ico--discover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5L12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1v-9.5z'/%3E%3C/svg%3E");
}

.xhs-rail-ico--publish {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}

.xhs-rail-extra {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
  margin-top: 4px;
}

.xhs-rail-extra-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none !important;
  color: var(--xhs-muted);
  font-size: 14px;
  box-sizing: border-box;
}

.xhs-rail-extra-link:hover {
  background: #f8f8f8;
  color: var(--xhs-text);
}

.xhs-rail-ico--more {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E");
}

.xhs-rail-ico--about {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 10v6M12 7h.01'/%3E%3C/svg%3E");
}

.xhs-rail-ico--article {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm-1 2 5 5h-5V4zM8 12h8v2H8v-2zm0 4h8v2H8v-2z'/%3E%3C/svg%3E");
}

.xhs-rail-ico--doc {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M4 6h16v2H4V6zm0 5h16v2H4v-2zm0 5h10v2H4v-2z'/%3E%3C/svg%3E");
}

.xhs-rail-ico--img {
  border-radius: 8px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.xhs-rail-empty {
  font-size: 11px;
  color: var(--xhs-muted);
  text-align: center;
  padding: 8px 4px;
}

.xhs-rail-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ===== 主区域：搜索框 + 分类 Tab + 瀑布流（内容区居中） ===== */
.xhs-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ===== 文章详情弹层：仅遮罩内容区，侧栏与首页布局不变 ===== */
.xhs-detail-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 12px 20px 20px 0;
  box-sizing: border-box;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
}

.xhs-detail-overlay[hidden] {
  display: none !important;
}

.xhs-detail-overlay-inner {
  width: var(--xhs-detail-max);
  max-width: 100%;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.xhs-detail-overlay-close {
  position: absolute;
  top: 28px;
  left: 16px;
  right: auto;
  z-index: 70;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.xhs-detail-overlay-close:hover {
  background: #fff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14) !important;
}

.xhs-detail-loading {
  padding: 48px 20px;
  text-align: center;
  color: var(--xhs-muted);
  font-size: 14px;
}

body.xhs-detail-open .xhs-feed-wrap {
  overflow: hidden;
}

.xhs-detail-overlay .xhs-note-shell {
  width: 100%;
  max-width: none;
  margin: 0;
}

.xhs-main-head {
  position: sticky;
  top: 0;
  z-index: 24;
  background: #fff;
  flex-shrink: 0;
  border-bottom: 1px solid transparent;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 搜索框（仿小红书宽圆角搜索） */
.xhs-search-zone {
  background: #fff;
  padding: 24px 32px 8px;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: var(--xhs-content-col);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.xhs-search-bar {
  position: relative;
  width: min(900px, 100%);
}

.xhs-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 88px 0 48px;
  border: 1px solid #eee;
  border-radius: 999px;
  background: #fff;
  font-size: 16px;
  color: var(--xhs-text);
  outline: none;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.xhs-search-input::placeholder {
  color: #999;
}

.xhs-search-input:focus {
  background: #fff;
  border-color: #e8e8e8;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.xhs-search-plus {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent center/18px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  opacity: 0.85;
  pointer-events: none;
}

.xhs-search-actions {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
}

.xhs-search-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent center/20px no-repeat;
  opacity: 0.72;
}

.xhs-search-action--camera {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
}

.xhs-search-action--search {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}

.xhs-search-drop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  max-height: 360px;
  overflow-y: auto;
}

.xhs-search-drop .bce-head-search-item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--xhs-text);
  border-bottom: 1px solid #f5f5f5;
}

.xhs-search-drop .bce-head-search-empty {
  padding: 16px;
  color: #999;
  font-size: 14px;
  text-align: center;
}

/* 一级分类 Tab（穿搭/美食 风格） */
.xhs-cat-tabs {
  background: #fff;
  width: 100%;
  max-width: var(--xhs-content-col);
  margin-left: auto;
  margin-right: auto;
  border-bottom: none;
  box-sizing: border-box;
}

.xhs-cat-tabs-scroll {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  padding: 6px 32px 0;
  max-width: 100%;
  margin: 0;
  scrollbar-width: none;
  box-sizing: border-box;
}

.xhs-cat-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.xhs-cat-tab {
  flex-shrink: 0;
  padding: 0 16px 14px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--xhs-muted);
  text-decoration: none !important;
  white-space: nowrap;
  transition: color 0.15s;
  position: relative;
}

.xhs-cat-tab:hover {
  color: var(--xhs-text);
}

.xhs-cat-tab.is-active {
  color: var(--xhs-red);
  font-weight: 600;
}

.xhs-cat-tab.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--xhs-red);
}

/* 二级菜单 Tab */
.xhs-tabs {
  position: static;
  top: auto;
  z-index: auto;
  background: #fff;
  border-bottom: none;
  flex-shrink: 0;
  width: 100%;
  max-width: var(--xhs-content-col);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.xhs-tabs--l2 .xhs-tabs-scroll {
  padding: 2px 32px 0;
  justify-content: center;
}

.xhs-tabs--l2 .xhs-tab {
  font-size: 16px;
  padding: 0 16px 14px;
  position: relative;
}

.xhs-tabs--l2 .xhs-tab.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--xhs-red);
}

.xhs-tabs-scroll {
  display: flex;
  justify-content: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 0 32px 12px;
  max-width: 100%;
  margin: 0;
  scrollbar-width: none;
  box-sizing: border-box;
}

.xhs-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.xhs-tab {
  flex-shrink: 0;
  padding: 0 14px;
  border-radius: 0;
  font-size: 14px;
  color: var(--xhs-muted);
  text-decoration: none !important;
  white-space: nowrap;
  transition: color 0.15s;
  background: none;
}

.xhs-tab:hover {
  color: var(--xhs-text);
  background: none;
}

.xhs-tab.is-active {
  color: var(--xhs-text);
  font-weight: 600;
  background: none;
}

.xhs-tabs--l2 .xhs-tab.is-active {
  color: var(--xhs-red);
  background: none;
}

.xhs-tabs--l3 {
  top: 0;
  background: #fff;
}

.xhs-feed-wrap {
  flex: 1;
  width: 100%;
  max-width: var(--xhs-content-col);
  margin-left: auto;
  margin-right: auto;
  padding: 4px 32px 48px;
  box-sizing: border-box;
}

.xhs-masonry {
  column-width: 224px;
  column-gap: 16px;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 1200px) {
  .xhs-masonry {
    column-width: calc((100% - 64px) / 5);
  }
}

.xhs-masonry--compact {
  column-width: 220px;
}

.xhs-card {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin-bottom: 20px;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  text-decoration: none !important;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease;
  border: none;
  vertical-align: top;
}

.xhs-card:hover {
  transform: translateY(-2px);
}

.xhs-card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / calc(3 * var(--xhs-ratio, 1.25));
  background: #f2f2f2;
  overflow: hidden;
  border-radius: 16px;
}

.xhs-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
}

.xhs-card-badge--video::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 5px;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #fff;
}

.xhs-card-author-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.xhs-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 16px;
}

.xhs-card-cover--placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #fff5f6 0%, #fff 45%, #f3f3f3 100%);
  color: #bbb;
  font-size: 13px;
  font-weight: 400;
  border-radius: 16px;
}

.xhs-card-body {
  padding: 12px 4px 8px;
}

.xhs-card-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--xhs-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.xhs-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: rgba(51, 51, 51, 0.6);
}

.xhs-card-author {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xhs-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e8e8e8;
  color: #666;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.xhs-avatar--lg {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.xhs-avatar--img {
  object-fit: cover;
  background: #eee;
  border: 1px solid #f0f0f0;
}

.xhs-card-like {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  color: rgba(51, 51, 51, 0.6);
}

.xhs-card-like svg {
  opacity: 0.85;
  flex-shrink: 0;
}

.xhs-empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--xhs-muted);
}

.xhs-empty p {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--xhs-text);
}

/* ===== 详情页（小红书笔记弹层：左图右文 + 浅色毛玻璃遮罩） ===== */
.xhs-app--detail {
  flex-direction: row;
  max-width: none;
  width: 100%;
  margin: 0;
  background: transparent;
  height: 100%;
}

.xhs-detail {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
}

.xhs-detail-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 12px 20px 20px 0;
  box-sizing: border-box;
  overflow-y: auto;
}

.xhs-note-shell {
  position: relative;
  width: var(--xhs-detail-max);
  max-width: 100%;
  margin: 0;
}

.xhs-note-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
}

.xhs-note-close {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.xhs-note-back-moments {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: #333;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.xhs-note-back-moments:hover {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.xhs-note-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  box-shadow: none;
  transform: scale(1.03);
  color: #111;
}

.xhs-note-close svg {
  display: block;
}

.xhs-note-card {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(380px, 1fr);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  min-height: min(86vh, 800px);
  max-height: calc(100vh - 40px);
}

/* 社区文章详情弹层：整体无外边框与阴影 */
.xhs-detail-overlay .xhs-note-card,
.xhs-app--detail .xhs-note-card {
  box-shadow: none;
  border: none;
}

.xhs-note-media {
  background: #111;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100%;
  max-height: calc(100vh - 40px);
  position: relative;
  overflow: hidden;
}

.xhs-note-media img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: calc(100vh - 40px);
  object-fit: cover;
  object-position: center center;
  display: block;
}

.xhs-note-media--text {
  background: linear-gradient(160deg, #fff5f6 0%, #fff 45%, #f3f3f3 100%);
}

.xhs-note-media-fallback {
  width: 100%;
  height: 100%;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  box-sizing: border-box;
}

.xhs-note-media-fallback-inner {
  max-width: 320px;
  text-align: center;
}

.xhs-note-media-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff0f2;
  color: var(--xhs-red);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.xhs-note-media-fallback-inner p {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.5;
  color: #444;
  font-weight: 600;
}

.xhs-note-media-hint {
  display: block;
  font-size: 13px;
  color: #999;
}

.xhs-note-media--video,
.xhs-note-media--carousel {
  background: #000;
}

.xhs-note-video {
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: calc(100vh - 40px);
  object-fit: cover;
  object-position: center center;
  display: block;
  background: #000;
}

.xhs-note-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.xhs-note-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.xhs-note-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.xhs-note-carousel-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.xhs-note-carousel-slide img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: calc(100vh - 40px);
  object-fit: cover;
  object-position: center center;
  display: block;
}

.xhs-note-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.xhs-note-carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.xhs-note-carousel-dot.is-active {
  background: #fff;
  transform: scale(1.15);
}

.xhs-note-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-left: none;
}

.xhs-detail-head {
  flex-shrink: 0;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f5f5f5;
}

.xhs-detail-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 24px 20px;
  scrollbar-width: thin;
}

.xhs-detail-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 18px;
  border-top: 1px solid #f5f5f5;
  background: #fff;
}

.xhs-detail-foot-login {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 10px 16px;
  border-radius: 999px;
  background: #f5f5f5;
  color: #999;
  font-size: 14px;
  text-decoration: none !important;
  text-align: left;
}

.xhs-detail-foot-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  margin-left: auto;
}

.xhs-detail-author-text {
  min-width: 0;
}

.xhs-detail-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.xhs-detail-author strong {
  display: block;
  font-size: 15px;
  color: var(--xhs-text);
}

.xhs-detail-author span {
  font-size: 12px;
  color: var(--xhs-muted);
}

.xhs-follow-btn {
  margin-left: auto;
  padding: 6px 18px;
  border-radius: 999px;
  border: none;
  background: var(--xhs-red);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.xhs-follow-btn.is-following {
  background: #f5f5f5;
  color: #666;
}

.xhs-detail-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--xhs-text);
}

.xhs-prose {
  font-size: 15px;
  line-height: 1.85;
  color: #333;
  margin-bottom: 8px;
}

.xhs-prose img {
  max-width: 100%;
  border-radius: 8px;
}

.xhs-prose p {
  margin: 0 0 1em;
}

.xhs-prose blockquote {
  margin: 1em 0;
  padding: 8px 16px;
  border-left: 4px solid #e0e0e0;
  background: #fafafa;
  color: #666;
}

.xhs-prose pre {
  margin: 1em 0;
  padding: 12px 16px;
  background: #f6f8fa;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}

.xhs-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}

.xhs-prose table td,
.xhs-prose table th {
  border: 1px solid #e8e8e8;
  padding: 8px 12px;
}

.xhs-prose video {
  max-width: 100%;
  border-radius: 8px;
}

.xhs-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 8px;
}

.xhs-detail-tags span {
  font-size: 13px;
  color: #507daf;
}

.xhs-detail-time {
  font-size: 12px;
  color: var(--xhs-muted);
  margin-bottom: 8px;
}

.xhs-detail-actions {
  display: none;
}

.xhs-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: var(--xhs-text);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.xhs-action-btn svg {
  color: #333;
  flex-shrink: 0;
}

.xhs-action-btn .xhs-action-count {
  color: var(--xhs-text);
  font-size: 13px;
  min-width: 0;
}

.xhs-comments {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #f5f5f5;
}

.xhs-comments h3 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
}

.xhs-comment {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.xhs-comment strong {
  font-size: 13px;
}

.xhs-comment p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #333;
}

.xhs-comment-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 0;
}

.xhs-comment-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: #333;
  word-break: break-word;
}

.xhs-comment-main {
  flex: 1;
  min-width: 0;
}

.xhs-comments-tip {
  font-size: 12px;
  color: var(--xhs-muted);
}

.xhs-action-btn.is-liked svg {
  color: var(--xhs-red);
  fill: var(--xhs-red);
  stroke: var(--xhs-red);
}

.xhs-action-btn.is-faved svg {
  color: #f5a623;
  fill: #f5a623;
  stroke: #f5a623;
}

.xhs-comment-compose {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
}

.xhs-comment-compose input {
  flex: 1;
  min-width: 0;
  border: none;
  background: #f5f5f5;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  color: #333;
  outline: none;
}

.xhs-related {
  display: none;
}

.xhs-paywall {
  margin: 16px 0;
  padding: 16px;
  border-radius: 12px;
  background: #fff8f0;
  border: 1px solid #ffe4c4;
}

.xhs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
}

.xhs-btn--primary {
  background: var(--xhs-red);
  color: #fff !important;
}

.xhs-btn--ghost {
  border: 1px solid var(--xhs-line);
  color: var(--xhs-text) !important;
  background: #fff;
}

.xhs-alert {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}

.xhs-alert--error {
  background: #fff2f0;
  color: #cf1322;
}

.xhs-alert--ok {
  background: #f6ffed;
  color: #389e0d;
}

@media (max-width: 1100px) {
  .xhs-masonry { column-width: 200px; column-gap: 14px; }
  .xhs-note-shell {
    width: 100%;
    max-width: none;
  }
  .xhs-note-toolbar {
    top: 12px;
    left: 12px;
    gap: 8px;
  }
  .xhs-note-toolbar .xhs-note-close {
    top: auto;
    left: auto;
    right: auto;
  }
  .xhs-detail-overlay-close {
    top: 12px;
    left: 12px;
    right: auto;
  }

  .xhs-detail-overlay,
  .xhs-detail-stage {
    padding-right: 12px;
  }
  .xhs-note-card {
    grid-template-columns: 1fr;
    min-height: auto;
    max-height: none;
  }
  .xhs-note-media,
  .xhs-note-media img,
  .xhs-note-media-fallback {
    min-height: 320px;
    max-height: 50vh;
  }
  .xhs-note-panel {
    max-height: none;
    border-left: none;
    border-top: none;
  }
}

@media (max-width: 768px) {
  .xhs-app {
    max-width: none;
  }

  .xhs-rail {
    width: 72px;
    --xhs-rail-w: 72px;
    padding: 12px 6px 16px;
  }
  .xhs-rail-logo {
    flex-direction: column;
    gap: 4px;
    padding: 0 4px;
    margin-bottom: 12px;
  }
  .xhs-rail-logo-name {
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .xhs-rail-item,
  .xhs-rail-user {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    min-height: 52px;
  }
  .xhs-rail-label,
  .xhs-rail-user-name {
    font-size: 10px;
    text-align: center;
  }
  .xhs-rail-login {
    min-height: 40px;
    font-size: 13px;
    padding: 0 8px;
  }
  .xhs-search-zone {
    padding: 12px 12px 6px;
  }
  .xhs-search-bar {
    width: 100%;
  }
  .xhs-search-input {
    height: 40px;
    font-size: 15px;
    padding-right: 72px;
  }
  .xhs-cat-tabs-scroll,
  .xhs-tabs--l2 .xhs-tabs-scroll,
  .xhs-tabs-scroll {
    justify-content: flex-start;
    padding-left: 12px;
    padding-right: 12px;
  }
  .xhs-cat-tab,
  .xhs-tabs--l2 .xhs-tab {
    font-size: 15px;
    padding: 0 12px 12px;
  }
  .xhs-masonry {
    column-width: calc(50% - 10px);
    column-gap: 10px;
  }
  .xhs-feed-wrap {
    padding: 4px 10px 32px;
  }
  .xhs-note-toolbar {
    top: 12px;
    left: 12px;
    gap: 8px;
  }
  .xhs-note-toolbar .xhs-note-close {
    top: auto;
    left: auto;
    right: auto;
  }
  .xhs-detail-overlay-close {
    top: 12px;
    left: 12px;
    right: auto;
  }
}

.xhs-feed-toolbar {
  display: none !important;
}

.xhs-publish-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: 20px;
  background: #ff2442;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(255, 36, 66, .25);
}

.xhs-publish-btn:hover {
  background: #e61f3a;
  color: #fff;
}

.xhs-action-btn.is-liked { color: var(--xhs-red); }
.xhs-action-btn.is-faved { color: #f5a623; }
.xhs-follow-btn.is-following {
  background: #f0f0f0;
  color: #666;
  border: none;
}

.xhs-comment--reply {
  margin-left: 36px;
  padding-left: 12px;
  border-left: 2px solid #f0f0f0;
}

.xhs-reply-btn {
  border: none;
  background: none;
  color: #1677ff;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

.xhs-btn--sm {
  padding: 6px 12px;
  font-size: 13px;
}
