/* ===================== 自适应设计变量层（新增） ===================== */
:root {
  /* 视口范围基准 */
  --vw-min: 320;
  --vw-max: 800;
  /* 基础流式因子（0~1） */
  --fluid-k: clamp(0, (100vw - var(--vw-min)*1px) / (var(--vw-max) - var(--vw-min)), 1);
  /* 统一页面底色变量（由 Banner 切换时更新） */
  --page-bg: #0e2118;
  --nav-bg: linear-gradient(to top,
       rgba(14, 33, 24, 1) 20%,
       rgba(14, 33, 24, 0.5) 50%,
       rgba(14, 33, 24, 0.1) 70%,
       rgba(14, 33, 24, 0) 100%);

  /* 字号层级（使用 clamp 平滑过渡） */
  --fs-base: clamp(14px, 14px + 0.6vw, 16px);
  --fs-xs: clamp(11px, 10px + 0.4vw, 12px);
  --fs-sm: clamp(12px, 11px + 0.45vw, 13.5px);
  --fs-md: clamp(14px, 3.5vw, 18px);
  --fs-lg: clamp(16px, 15px + 0.6vw, 20px);
  --fs-xl: clamp(18px, 16px + 0.9vw, 24px);

  /* 圆角与间距 */
  --radius-sm: clamp(6px, 5px + 0.4vw, 8px);
  --radius-md: clamp(12px, 10px + 0.6vw, 16px);
  --radius-pill: 9999px;

  --space-2: clamp(2px, 1px + 0.2vw, 4px);
  --space-4: clamp(4px, 3px + 0.3vw, 6px);
  --space-6: clamp(6px, 5px + 0.4vw, 8px);
  --space-8: clamp(8px, 7px + 0.5vw, 12px);
  --space-10: clamp(10px, 8px + 0.6vw, 14px);
  --space-12: clamp(12px, 10px + 0.7vw, 16px);
  --space-16: clamp(16px, 14px + 0.8vw, 20px);
  --space-20: clamp(20px, 16px + 1vw, 28px);

  /* 缩略图尺寸与派生高度 */
  --thumb-size: clamp(60px, 48px + 6vw, 100px);
  --post-height: calc(var(--thumb-size) + var(--space-12) + var(--space-12));

  /* 分享面板宽度与底部导航高度 */
  --share-panel-w: clamp(120px, 22vw, 200px);
  --nav-height: clamp(52px, 14vw, 72px);

  /* Pull 指示条高度 */
  --pull-h: clamp(52px, 42px + 2vw, 64px);

  /* 顶/底安全区：先 constant 再 env，最后回退 0 */
  --sat: constant(safe-area-inset-top);
  --sab: constant(safe-area-inset-bottom);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* 禁止按钮、tab、icon等被选中，提升体验 */
.btn,
.button,
.tab,
.icon,
.icon-content,
.share-item,
.search-btn-text,
.banner-dot,
.dropdown-item,
.ad-slot,
.navbar button,
.navbar a,
.navbar span {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
  cursor: pointer;
}

/* play、all game、微博等按钮单独补充 */
.play-btn,
.allgame-btn,
.share-item[data-share],
.share-item {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
  cursor: pointer;
}

/* ===================== 全局基础样式 ===================== */
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: var(--fs-base);
  /* CSS 加载后由变量接管（首帧仍由内联 html 背景提供） */
  background: var(--page-bg, #0e2118);
  transition: background 300ms ease;
}

body {
  max-width: 800px;
  min-width: 320px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0;
  font-family: Arial, sans-serif;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

@media (min-width: 600px) {
  html {
    overflow-y: scroll;
  }
}

/* ===================== 布局结构 ===================== */
header {
  position: relative;
  padding: 0;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

header nav {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
}

header nav ul {
  display: flex;
  list-style-type: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
}

header nav ul li {
  padding: 10px 20px;
  cursor: pointer;
}

header nav ul li.active {
  background-color: #555;
}

.container {
  margin: 0 0 15px 0;
  padding: 5px 15px;
}

/* 搜索结果时container增加背景色（保持原逻辑优先级更高） */
main.container[data-search-active="true"] {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  transition: background 0.3s;
}

/* ===================== 搜索栏组件 ===================== */
#search-bar {
  display: flex;
  align-items: center;
  gap: 0;
}

.search-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  padding: 2px 8px 2px 8px;
  margin: 12px 0 12px 0;
  height: clamp(40px, 32px + 2vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 5;
  transition: background 0.15s, box-shadow 0.15s;
  backdrop-filter: blur(5px) saturate(120%);
  -webkit-backdrop-filter: blur(5px) saturate(120%);
}

.search-bar-wrapper.search-active,
.search-bar-wrapper:focus-within {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.1s, background 0.1s;
}

.search-bar-wrapper:not(.search-active) {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.3s, background 0.3s;
}

.search-bar-wrapper.search-blur-wait.search-active {
  pointer-events: none;
}

#searchInput {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-md);
  padding: 4px 0 4px 4px;
  color: #222;
  height: calc(100% - var(--space-4));
}

#searchInput::placeholder {
  color: #aaa;
  font-size: var(--fs-sm);
}

#searchInput.placeholder-flash::placeholder {
  color: #d90000;
  transition: color 0.2s, font-size 0.2s;
  opacity: 1;
}

#search-clear-btn {
  display: none;
  margin: 0 6px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(0, 0, 0, 0);
  color: #888;
  font-size: 16px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.2s;
}

#search-clear-btn:hover {
  color: rgba(0, 0, 0, 0.8);
  font-size: 20px;
}

#searchBtn {
  border: none;
  background: rgba(0, 0, 0, 0);
  border-radius: 18px;
  font-size: var(--fs-sm);
  padding: 8px 18px;
  margin-left: 8px;
  cursor: pointer;
  transition: background 0.2s;
  height: 36px;
  min-width: 60px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

#searchBtn i {
  display: flex;
  align-items: center;
  justify-content: center;
}

#searchBtn:hover {
  background: rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.2s, background 0.2s;
}

#searchBtn:active {
  background: rgba(0, 0, 0, 0.2);
  box-shadow: none;
  transition: background 0.2s;
  outline: none;
  border: none;
}

.search-bar-wrapper.search-active #searchBtn,
.search-bar-wrapper:focus-within #searchBtn {
  background: rgba(0, 0, 0, 0.1);
  transition: background 0.2s;
}

.search-bar-wrapper.search-active #searchBtn:hover,
.search-bar-wrapper:focus-within #searchBtn:hover {
  background: rgba(0, 0, 0, 0.2);
  transition: background 0.2s;
}

.search-bar-wrapper.search-active #searchBtn:active,
.search-bar-wrapper:focus-within #searchBtn:active {
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.2s;
}

/* ===================== 搜索历史组件 ===================== */
#search-history-dropdown {
  display: none;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #e5e5ea;
  padding: 0;
  min-height: 0;
  margin-top: -40px;
  border-radius: 0 0 14px 14px;
  box-shadow: none;
  position: static;
  width: auto;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform-origin: top;
  transition: max-height 0.25s ease-out, opacity 0.25s ease-out, padding 0.25s ease-out, margin-top 0.25s ease-out;
  z-index: 2;
}

#search-history-dropdown.hiding {
  max-height: 40px;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: -40px;
}

#search-history-dropdown.showing {
  max-height: 300px;
  opacity: 1;
  padding: 35px 12px 12px;
  margin-top: -40px;
}

.clear-searchHistory {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 18px;
  margin: 0 8px 4px 4px;
}

.search-history-title {
  text-align: left;
  flex: 1;
  color: rgba(136, 136, 136 , .7);
  font-size: 12px;
}

.fas {
  margin: 0 2px 0 0;
}

.fa-close {
  justify-content: center;
  color: rgba(136, 136, 136 , .3);
  font-size: 14px;
}

.fa-close:hover {
  cursor: pointer;
  font-size: 18px;
  transition: color 0.2s, font-size 0.2s;
}

.search-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.25);
  color: #222;
  border-radius: 12px;
  padding: 2px 4px 2px 10px;
  font-size: 12px;
  margin: 3px 8px 3px 0;
  position: relative;
  transition: background 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  height: 24px;
  line-height: 20px;
  min-width: 0;
  box-sizing: border-box;
}

.search-tag:hover {
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: background 0.2s;
}

.search-tag:active {
  background: rgba(255, 255, 255, 0.8);
  transition: background 0.1s;
}

.search-tag .tag-close {
  margin-left: 8px;
  color: rgba(136, 136, 136 , .3);
  font-size: 16px;
  cursor: pointer;
  border: none;
  background: transparent;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.search-tag .tag-close:hover {
  background: #d1d1d6;
  color: #333;
  font-size: 24px;
  transition: background 0.2s, color 0.2s, font-size 0.2s;
}

/* ===================== 搜索结果组件 ===================== */
.search-results-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-align: left;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.search-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  margin-left: 12px;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 13px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 48px;
  height: 26px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.search-back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.search-back-btn:active {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(0);
  transition: background 0.1s, transform 0.1s;
}

.no-search-results {
  text-align: center;
  margin: 40px 16px;
  padding: 32px 16px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

/* ===================== posts容器和占位符系统 ===================== */
#posts-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

/* 骨架 & 占位符 */
.post-placeholder {
  display: flex;
  position: relative;
  padding: var(--space-12);
  margin: 0;
  background: rgba(246, 248, 239, 0.5);
  border: none;
  border-radius: var(--radius-md);
  height: var(--post-height);
  overflow: hidden;
  background: rgba(246, 248, 239, 0.5);
}

.post-placeholder .placeholder-content {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: flex-start;
}

.post-placeholder .placeholder-thumbnail {
  width: var(--thumb-size);
  height: var(--thumb-size);
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.post-placeholder .placeholder-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-placeholder .placeholder-title {
  height: 20px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  width: 80%;
}

.post-placeholder .placeholder-desc {
  height: 16px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  width: 60%;
}

.post-placeholder .placeholder-meta {
  height: 14px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  width: 40%;
  margin-top: auto;
}

.post-placeholder .placeholder-action {
  width: 60px;
  height: 32px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 15px;
  margin-left: 8px;
  align-self: center;
}

/* 实际post样式 */
.post {
  display: flex;
  position: relative;
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUpScale 0.4s cubic-bezier(.23, 1, .32, 1) forwards;
}

.post-item {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: stretch;
}

.post-thumbnail {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.thumbnail {
  width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: rgba(0, 0, 0, 0.05);
  opacity: 0;
  transition: opacity 0.4s;
}

.thumbnail.loaded {
  opacity: 1;
}

.post-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-content p a {
  color: inherit;
  text-decoration: none;
}

.post h3 {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.post h3 a {
  text-decoration: none;
  color: #1a1a1a;
  display: block;
  transition: color 0.2s ease;
}

.post h3 a:hover {
  color: var(--current-color, #007aff);
  text-decoration: none;
}

.post p {
  margin: 0;
  color: #666;
  font-size: var(--fs-sm);
  line-height: 1.4;
}

.post small {
  color: #999;
  font-size: var(--fs-xs);
  margin-top: auto;
  display: flex;
  align-items: center;
}

.post small i {
  font-size: 11px;
}

.fa-ghost {
  margin-left: 12px;
}

/* post右侧按钮 */
.post-action {
  display: flex;
  align-items: center;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-16);
  background: linear-gradient(90deg, #204d38 0%, #0e2118 100%);
  color: #b3fd25;
  border: none;
  border-radius: 18px;
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0, 122, 255, 0.08);
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
  white-space: nowrap;
}

.play-btn:hover {
  background: linear-gradient(90deg, #0e2118 0%, #204d38 100%);
  transform: translateY(-2px) scale(1.04);
}

.play-btn:active {
  background: #0e2118;
  transform: scale(0.97);
}

/* 减少滑动误触：允许浏览器优先处理纵向滚动，横向手势由脚本判断 */
.post, .post .post-inner {
  touch-action: pan-y;
}

.post .post-inner {
  position: relative;
  flex: 1 1 auto;
  display: block;
  min-width: 0;
  transition: box-shadow 0.2s, background 0.2s, transform 0.2s;
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: clamp(12px, 2.5vw, 16px);
  background: rgba(246, 248, 239, 0.9);
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.post .post-inner:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
  transition: box-shadow 0.2s, background 0.2s, transform 0.2s;
}

/* 右下角按钮 */
.share-toggle-btn {
  position: absolute;
  right: clamp(8px, 2vw, 12px);
  bottom: clamp(6px, 1vw, 10px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: color .18s, transform .18s;
  padding: 0;
  outline: none;
}

.share-toggle-btn i.fa-share-alt {
  font-size: clamp(12px, 5vw, 18px);
  color: rgba(14, 33, 24, 0.1);
  transition: color .18s, transform .18s, box-shadow .18s;
  pointer-events: none;
}

.share-toggle-btn:hover i.fa-share-alt,
.share-toggle-btn:focus i.fa-share-alt {
  color: rgba(14, 33, 24, 0.8);
  transform: scale(1.18);
}

.share-toggle-btn:active i.fa-share-alt {
  color: rgba(14, 33, 24, 0.8);
  transform: scale(0.92);
}

/* 分享面板容器 */
.share-panel {
  width: 0;
  min-width: 0;
  max-width: 200px;
  overflow: hidden;
  transition: width .18s cubic-bezier(.4, 0, .2, 1), margin-left .18s cubic-bezier(.4, 0, .2, 1), background .15s cubic-bezier(.4, 0, .2, 1);
  flex: 0 0 auto;
  position: relative;
  background: transparent;
  border-radius: 0 12px 12px 0;
  margin-left: 0;
}

.post.share-open .share-panel {
  width: var(--share-panel-w);
  margin-left: -12px;
  background: rgba(255, 255, 255, 0.5);
}

.share-panel-inner {
  position: relative;
  padding: 10px 8px 12px 20px;
  display: none;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity .12s .03s, transform .15s;
  pointer-events: none;
  height: auto;
  max-height: 240px;
  overflow: visible;
}

.post.share-open .share-panel-inner {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.share-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(14, 33, 24, 1);
  letter-spacing: .5px;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: 8px;
}

.share-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-item {
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: rgba(14, 33, 24, .7);
  font-size: 12px;
  padding: 6px 6px;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  transition: background .18s, transform .18s;
  position: relative;
  overflow: hidden;
}

.share-item:hover {
  background: #e9eaec;
}

.share-item:active {
  transform: scale(.95);
}

.share-item .copydone {
  display: none;
  margin-left: auto;
  vertical-align: middle;
  width: clamp(14px, 4vw, 16px);
  height: clamp(14px, 4vw, 16px);
}

.share-item.copied .copydone {
  display: inline-block;
}

.share-item[data-share="copy"] {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 0;
  width: auto;
  box-sizing: border-box;
  flex-wrap: wrap;
  max-width: 100%;
}

.share-item[data-share="copy"] .copy-text {
  display: inline;
  height: auto;
  vertical-align: middle;
  transition: color 0.2s;
  word-break: break-all;
  white-space: normal;
  text-align: center;
  max-width: 100%;
  flex: 1 1 0;
}

.share-item[data-share="copy"] .copydone {
  display: none;
  width: clamp(14px, 4vw, 16px);
  height: clamp(14px, 4vw, 16px);
  vertical-align: middle;
  flex-shrink: 0;
}

.share-item[data-share="copy"].copied .copydone {
  display: inline-block;
}

.share-item[data-share="copy"].copied .copy-text {
  color: #2ecc40;
}

.post.share-open .post-inner {
  filter: saturate(.92);
  z-index: 1;
  background: rgba(255, 255, 255, 1);
}

.share-icon {
  width: clamp(14px, 4vw, 16px);
  height: clamp(14px, 4vw, 16px);
  flex-shrink: 0;
  object-fit: contain;
  margin: 0 clamp(2px, 2vw, 6px) 0 clamp(2px, 2vw, 4px);
}

.share-item img.share-icon,
.share-item img {
  filter: grayscale(1) brightness(.8) opacity(0.4);
  transition: filter 0.2s, opacity 0.2s;
}

.share-item:active img.share-icon,
.share-item:focus img.share-icon,
.share-item:hover img-share-icon,
.share-item.active img-share-icon,
.share-item:active img,
.share-item:focus img,
.share-item:hover img,
.share-item.active img {
  filter: none;
  opacity: 1;
}

/* 微信二维码弹窗整体遮罩 */
#wechat-qr-modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(32, 77, 56, 0.18);
  backdrop-filter: blur(4px);
}

#wechat-qr-modal[style*="display: none"] {
  display: none;
}

/* 弹窗内容 */
.wechat-qr-content {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.12);
  padding: 12px 18px 18px 24px;
  width: clamp(260px, 98vw, 420px);
  min-height: clamp(260px, 50vw, 320px);
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  position: relative;
}

@media (max-width: 480px) {
  .wechat-qr-content {
    padding: 12px 6px 12px 18px;
    width: clamp(220px, 80vw, 340px);
    min-width: 260px;
    min-height: clamp(260px, 80vw, 420px);
  }

  .wechat-qr-header {
    margin-bottom: 8px;
  }
}

/* 顶部标题和关闭按钮 */
.wechat-qr-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

#wechat-qr-title {
  font-size: 20px;
  font-weight: 600;
  color: rgba(14, 33, 24, 1);
  letter-spacing: 1px;
}

.wechat-qr-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #666;
  cursor: pointer;
  padding: 6px 12px;
  line-height: 1;
}

.wechat-qr-close-btn:hover {
  background: #f2f2f2;
  color: rgba(14, 33, 24, 1);
  border-radius: 20px;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

/* 二维码区域 */
.wechat-qr-code {
  margin: 0 auto 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 描述文字 */
.wechat-qr-desc {
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: #204d38;
  margin-bottom: 8px;
}

/* 失败部分 */
.wechat-qr-fail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wechat-qr-fail-title {
  font-size: 18px;
  font-weight: bold;
  color: #d32f2f;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.wechat-qr-fail-info {
  padding: 18px 12px;
  margin: 0 12px 12px 6px;
  line-height: 18px;
  font-size: 14px;
  word-break: break-all;
  box-sizing: border-box;
  background: rgba(179, 179, 179, 0.2);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: rgba(179, 179, 179, 0) 1px solid;
  min-width: clamp(200px, 60vw, 320px);
}

.wechat-qr-fail-info a {
  color: #204d38;
  text-decoration: underline;
}

.wechat-copy-btn {
  margin-top: 0;
  margin-bottom: 8px;
  display: inline-block;
  padding: 7px 22px;
  border: none;
  background: #eee;
  border-radius: 18px;
  cursor: pointer;
  font-size: 15px;
  color: rgba(14, 33, 24, .3);
  transition: background 0.2s;
}

.wechat-copy-btn:hover
{
  background: #d1e7dd;
}

.wechat-copy-btn:active {
  background: #eee;
}

.wechat-copy-tip {
  min-height: 20px;
  color: #2ecc40;
  margin: 8px;
  font-size: 13px;
  display: block;
  opacity: 0;
  transition: opacity 0.2s;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.wechat-copy-tip.show {
  opacity: 1;
}

.wechat-qr-fail-mobile {
  font-size: 12px;
  color: #999;
  margin: 8px 0 2px 30px;
  width: 100%;
}

.wechat-qr-fail-info.flash {
  animation: flashTip 0.8s;
}

@keyframes flashTip {
  0% {
    background: #fff;
    color: #2e7d32;
    border: #2ecc40 1px solid;
  }
  20% {
    background: #d1e7dd;
    color: #204d38;
  }
  50% {
    background: #fff;
    color: #2e7d32;
    border: #2ecc40 1px solid;
  }
  80% {
    background: #d1e7dd;
    color: #204d38;
  }
  100% {
    background: #fff;
    color: #2e7d32;
    border: #2ecc40 1px solid;
  }
}

/* post特殊类型样式 */
[data-type="hot"] .post {
  border-left: 3px solid #ff6b6b;
}

[data-type="hot"] .post:hover {
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.15);
  border-left: 3px solid #ff6b6b;
  cursor: pointer;
}

[data-type="latest"] .post {
  border-left: 3px solid #4caf50;
}

[data-type="latest"] .post:hover {
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.15);
  border-left: 3px solid #4caf50;
}

.no-more-data {
  text-align: center;
  padding: 10px 0 20px 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: clamp(12px, 3vw, 14px);
}

.copyright-info {
  text-align: center;
  color: rgba(255, 255, 255, 0.2);
  font-size: clamp(12px, 3vw, 14px);
}

.copyright-info a {
  color: inherit;            /* 继承父级淡色，不再单独高亮 */
  text-decoration: none;
  cursor: pointer;
}

.end-bottom-space {
  height: 1px;
  margin: 0 0 clamp(30px, 5.5vw, 40px) 0;
}

/* ===================== badge组件和动画 ===================== */
.hot-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(45deg, rgba(255, 128, 128, 0.7), rgba(255, 128, 128, 0.5));
  color: white;
  padding: 3px 6px;
  border-radius: 12px;
  font-size: 10px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: box-shadow 0.3s ease;
}

.new-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(45deg, rgba(76, 175, 79, 0.8), rgba(76, 175, 79, 0.5));
  color: white;
  padding: 3px 6px;
  border-radius: 12px;
  font-size: 10px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: box-shadow 0.3s ease;
}

.hot-rank {
  font-weight: normal;
  font-size: 10px;
}

.new-text {
  font-weight: bold;
  font-size: 9px;
}

.post:hover .hot-badge {
  animation: hotPulse 2s infinite;
}

.post:hover .hot-badge i {
  animation: fireFlicker 1.5s infinite alternate;
}

.post:hover .new-badge {
  animation: newGlow 2s infinite;
}

.post:hover .new-badge i {
  animation: sparkle 1.8s infinite alternate;
}

/* ===================== 导航和语言切换 ===================== */
.navbar {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 20px;
  box-sizing: border-box;
  background: none;
}

.language-wrapper {
  position: relative;
  cursor: pointer;
}

.language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 6px;
  border: 0px solid black;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s;
}

.language-button:hover {
  background: rgba(0, 0, 0, 0.5);
}

.dropdown-menu {
  opacity: 0.2;
  visibility: hidden;
  position: absolute;
  top: 40px;
  right: 0;
  min-width: 120px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  padding: 6px 0;
  z-index: 1000;
  transition: opacity 0.2s, visibility 0.2s;
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 15px;
  font-size: 12px;
  color: black;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, .4);
}

.language-wrapper:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.dropdown-icon,
.button-icon {
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.button-content {
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ===================== 顶/底安全区样式（通顶覆盖） ===================== */
.safe-top-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--sat, 0px);
  background: transparent no-repeat center top;
  background-size: cover;
  z-index: 9999;
  pointer-events: none;
  /* 柔化与 Banner 接缝，避免断层 */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
}
.has-safe-pad-top { padding-top: var(--sat, 0px); }
.has-safe-pad-bottom { padding-bottom: var(--sab, 0px); }

/* ===================== banner组件 ===================== */
.header_banner {
  width: 100%;
  aspect-ratio: 640/246;
  position: relative;
  overflow: hidden;
  background: #0e2118;
  display: block;
  border-radius: 0;
}

.banner-slide {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.banner-slide.active {
  display: flex;
}

.banner-slide img,
.header_banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.3s;
}

.banner-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: 8px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 2;
}

.banner-dot {
  width: clamp(6px, 1vw, 8px);
  height: clamp(6px, 1vw, 8px);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
  display: inline-block;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
  pointer-events: auto;
}

.banner-dot.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.5);
  width: clamp(14px, 3vw, 18px);
  border-radius: 8px;
}

/* ===================== 底部导航菜单 ===================== */
.icon_container-bg {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: var(--sab);
  height: clamp(80px, 16vw, 100px);
  z-index: 100;
  pointer-events: none;
  background: var(--nav-bg);
  transition: background 300ms ease;
}

.icon_container {
  box-sizing: border-box;
  max-width: 800px;
  min-width: 320px;
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  /* 无安全区：12px；有安全区：使用 safe-area 值（如 34px） */
  bottom: 12px;                                 /* 回退（不支持 clamp 的环境） */
  bottom: clamp(12px, var(--sab), 100vh);       /* 首选：在 12px 与 --sab 中取较大 */
  z-index: 101;
  height: var(--nav-height);
  width: calc(100% - 20px);
  margin: 0 auto;
  flex-flow: row nowrap;
  justify-content: space-around;
  background: var(--navigation-container-color, rgb(248, 255, 236, .7));
  border-radius: clamp(18px, 4vw, 24px);
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}

.icon {
  flex: 1;
  display: flex;
  flex-flow: column nowrap;
  align-items: center;
  justify-content: center;
  font-size: clamp(12px, 3vw, 16px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  padding: 0 2px;
  min-width: 0;
}

.icon i {
  padding: 0 0 2px 0;
  font-size: clamp(15px, 6vw, 20px);
}

.icon-content {
  display: none;
  color: grey;
  font-size: clamp(12px, 3vw, 18px);
  transition: opacity 0.3s ease-in-out;
  white-space: nowrap; /* 防止文字换行 */
  padding: 0px 6px;
  align-items: center; /* 垂直居中 */
  justify-content: center; /* 水平居中 */
}

.icon:focus .icon-content,
.icon.active .icon-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--current-bg-color);
  /* width: 60%; */
  /* width: clamp(60%, 12vw, 80%); */ 
  border-radius: clamp(15px, 3vw, 20px);
  color: var(--current-color, grey);
  text-align: center;
}

.icon:focus,
.icon.active {
  background: var(--current-bg-color);
  color: var(--current-color);
  opacity: 1;
}

/* ===================== GDPR弹窗 ===================== */
#gdpr-banner {
  box-sizing: border-box;
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 1.5px 4px rgba(0, 0, 0, 0.08);
  padding: 20px 12px 16px 12px;
  z-index: 9999;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: gdprFadeIn 0.4s;
  background: rgba(0, 0, 0, 0.9);
}

#gdpr-banner #gdpr-text {
  display: inline;
  color: #fff;
  word-break: break-word;
  white-space: normal;
}

#gdpr-banner #gdpr-privacy-link {
  color: #4fc3f7;
  text-decoration: underline;
  margin: 0 2px;
}

#gdpr-banner #accept-cookies {
  display: block;
  width: 50%;
  max-width: 500px;
  margin: 18px auto;
  padding: 8px 32px;
  background: linear-gradient(90deg, #4fc3f7 0%, #007aff 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.08);
  cursor: pointer;
  transition: background 0.2s;
}

#gdpr-banner #accept-cookies:active {
  background: #007aff;
  transform: scale(0.97);
}

/* ===================== 动画定义 ===================== */
@keyframes fadeInUpScale {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
    border-radius: 12px;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    border-radius: 12px;
  }
}

@keyframes skeleton-loading {
  0% {
    background-position: -200% 0;
    border-radius: 12px;
  }
  100% {
    background-position: 200% 0;
    border-radius: 12px;
  }
}

@keyframes gdprFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fireFlicker {
  0% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.6) rotate(2deg); }
  100% { transform: scale(1) rotate(-1deg); }
}

@keyframes hotPulse {
  0% { box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3); }
  50% { box-shadow: 0 2px 12px rgba(255, 107, 107, 0.5); }
  100% { box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3); }
}

@keyframes sparkle {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

@keyframes newGlow {
  0% { box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3); }
  50% { box-shadow: 0 2px 12px rgba(76, 175, 80, 0.5); }
  100% { box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3); }
}

/* ===================== 轻量骨架占位 ============ */
:root {
  --sk-card-bg: rgba(246, 248, 239, 0.7);
  --sk-block-bg: rgba(0, 0, 0, 0.08);
}

#posts-container.skeleton-active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-skeleton {
  display: grid;
  grid-template-columns: calc(var(--thumb-size) - 16px) 1fr 56px;
  grid-template-rows: 22px 18px 18px;
  gap: 10px 14px;
  align-items: center;
  padding: var(--space-12);
  border-radius: var(--radius-md);
  background: var(--sk-card-bg);
  height: var(--post-height);
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: var(--post-height);
  contain: content;
}

.post-skeleton .sk-thumb {
  grid-row: 1 / span 3;
  width: calc(var(--thumb-size) - 16px);
  height: calc(var(--thumb-size) - 16px);
  border-radius: var(--radius-sm);
  background: var(--sk-block-bg);
}

.post-skeleton .sk-title {
  height: 18px;
  border-radius: 6px;
  background: var(--sk-block-bg);
  width: 70%;
}

.post-skeleton .sk-desc {
  height: 14px;
  border-radius: 6px;
  background: var(--sk-block-bg);
  width: 90%;
}

.post-skeleton .sk-meta {
  height: 12px;
  border-radius: 6px;
  background: var(--sk-block-bg);
  width: 50%;
}

.post-skeleton .sk-action {
  grid-column: 3;
  grid-row: 1 / span 3;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--sk-block-bg);
  justify-self: end;
}

@media (max-width: 480px) {
  .post-skeleton {
    height: calc(var(--post-height) * 0.85);
    contain-intrinsic-size: calc(var(--post-height) * 0.85);
  }
  .post-skeleton .sk-thumb {
    width: calc((var(--thumb-size) - 16px) * 0.85);
    height: calc((var(--thumb-size) - 16px) * 0.85);
  }
}

/* ===================== 响应式设计微调 ===================== */
@media (max-width: 800px) {
  body,
  header,
  header nav,
  header nav ul {
    max-width: 100%;
  }

  #posts-container {
    gap: 14px;
    margin-top: 20px;
  }

  #gdpr-banner {
    max-width: 100vw;
    padding: 14px 4vw 10px 4vw;
    font-size: 15px;
  }

  #gdpr-banner #accept-cookies {
    width: 90%;
    padding: 10px 0;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .search-bar-wrapper {
    height: 40px;
  }

  #searchInput {
    font-size: 15px;
    height: 34px;
    padding: 4px 0px 4px 6px;
  }

  #search-clear-btn {
    width: 20px;
    height: 20px;
    font-size: 15px;
    margin: 0 4px;
    text-align: center;
    align-items: center;
    display: flex;
  }

  #searchBtn {
    min-width: 54px;
    max-width: 70px;
    font-size: 14px;
    padding: 6px 10px;
    margin-left: 4px;
    height: 32px;
    border-radius: 16px;
    -webkit-tap-highlight-color: transparent;
    outline: none;
  }

  .search-results-count {
    margin: 0 12px;
    font-size: 13px;
    border-radius: 6px;
  }

  .search-back-btn {
    margin-left: 8px;
    padding: 3px 8px;
    font-size: 11px;
    min-width: 40px;
    height: 22px;
    border-radius: 6px;
  }

  #posts-container {
    gap: 12px;
    margin-top: 16px;
  }

  .play-btn {
    padding: 5px 10px;
    font-size: 13px;
  }
}

/* ===================== 触摸设备优化 ===================== */
@media (hover: none) and (pointer: coarse) {
  .post:active {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(0.98);
    transition: background 0.1s, transform 0.1s;
  }
}

/* ===================== 下推tips样式 ===================== */
.pull-indicator {
  width: 100%;
  height: 0;
  box-sizing: border-box;
  overflow: hidden;
  background: rgba(160, 160, 160, 0.5);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 12px 16px -12px rgba(0, 0, 0, 0.6),
    inset 0 -12px 16px -12px rgba(0, 0, 0, 0.6);
  transition: height 0.3s cubic-bezier(.4, 0, .2, 1);
  font-size: var(--fs-sm);
}

.pull-indicator.active {
  height: var(--pull-h);
}

.pull-content {
  color: rgba(178, 215, 178, 0.9);
  letter-spacing: 1px;
  line-height: 1.4;
  text-align: center;
  padding: 0 var(--space-8);
  word-break: break-all;
  font-size: clamp(12px, 3.5vw, 14px);
}