/* 桃心视频主题补充样式 */
:root { --tw-gold: var(--app-gold, #A9853F); }

/* 五列 / 四列 / 两列 */
.quick-grid.layout-grid5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.quick-grid.layout-grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.quick-grid.layout-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-grid.layout-grid2 .quick-item { padding: 12px 8px; }
.quick-grid.layout-grid2 .quick-icon img { width: 72px; height: 72px; border-radius: 10px; }
.quick-grid.layout-grid2 .quick-item > span:last-child { font-size: 13px; }

/* 分区标题（区块名称非空时显示） */
.tw-section-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 2px 10px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #6b5a2f;
  background: linear-gradient(135deg, #f7e7bd, #ecd9a4);
  border-radius: 999px;
}

/* 空状态 */
.tw-empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--app-text-regular, #6E675A);
  font-size: 13px;
}
.tw-empty-ico { font-size: 34px; margin-bottom: 8px; }
.tw-empty p { margin: 4px 0; }
.tw-empty-sub { color: var(--app-text-muted, #9C9384); font-size: 12px; }
.tw-back-home {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  color: #fff;
  background: var(--app-gold-gradient, linear-gradient(135deg, #EECD82, #C79A3E));
  font-weight: 600;
}

/* 版权 */
.tw-copyright {
  padding: 14px 12px 74px;
  text-align: center;
  font-size: 11px;
  color: var(--app-text-faint, #ABA396);
}

/* 广告位 */
.tw-ad-banner, .tw-ad-bottom { padding: 2px 0 10px; }
.tw-ad-banner .ad-image img,
.tw-ad-bottom .ad-image img { width: 100%; border-radius: 12px; display: block; }
.tw-ad-banner .ad-text,
.tw-ad-bottom .ad-text {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed #e2d9c6;
  color: #8a7b56;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 搜索页 */
.tw-search-page { padding: 2px 0 10px; }
.tw-search-form { display: flex; gap: 8px; margin-bottom: 12px; }
.tw-search-form input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #e7dfcf;
  background: #fff;
  color: var(--app-ink, #1C1915);
  font-size: 13px;
  outline: none;
}
.tw-search-form input:focus { border-color: var(--app-gold-bar, #D7B56D); }
.tw-search-form button {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--app-gold-gradient, linear-gradient(135deg, #EECD82, #C79A3E));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.tw-search-hint { margin: 0 2px 10px; font-size: 12px; color: var(--app-text-muted, #9C9384); }
.tw-pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 16px 0; }
.tw-pager-item {
  min-width: 30px;
  padding: 5px 10px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #e7dfcf;
  font-size: 12px;
  text-align: center;
  color: #6E675A;
}
.tw-pager-item.is-active { background: var(--app-gold-gradient, linear-gradient(135deg, #EECD82, #C79A3E)); border-color: transparent; color: #fff; font-weight: 700; }

/* 单页 */
.tw-page {
  margin: 6px 0 20px;
  padding: 18px 16px;
  background: #fff;
  border: 1px solid #f1ede3;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(28, 25, 21, .04);
}
.tw-page-title { margin: 0 0 12px; font-size: 18px; font-weight: 700; color: var(--app-ink, #1C1915); }
.tw-page-body { font-size: 13.5px; line-height: 1.85; color: var(--app-text-secondary, #57503F); word-break: break-word; }
.tw-page-body p { margin: 0 0 10px; }
.tw-page-body a { color: var(--app-gold, #A9853F); text-decoration: underline; }
.tw-page-body img { max-width: 100%; border-radius: 10px; }

/* 弹窗广告 */
.tw-popup { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.tw-popup[hidden] { display: none; }
.tw-popup-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .66); }
.tw-popup-box { position: relative; z-index: 1; }
.tw-popup-close {
  position: absolute; top: -38px; right: 0;
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .2); color: #fff; font-size: 13px;
}

/* 悬浮广告位 */
.float-ads {
  position: fixed;
  right: 14px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  padding: 0 12px;
  border-radius: 26px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: var(--app-gold-gradient, linear-gradient(135deg, #EECD82, #C79A3E));
  box-shadow: 0 10px 24px rgba(199, 154, 62, .35);
  text-align: center;
}
.float-ads img { width: 100%; height: 100%; object-fit: cover; border-radius: 26px; }

/* 安装条关闭动画 */
.home-install-banner.is-closing { transition: opacity .2s ease, transform .2s ease; opacity: 0; transform: translateY(-6px); }

/* ================= 视频 / 短视频 / 小说 ================= */

/* 视频列表 */
.tw-video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; margin-bottom: 16px; }
.tw-video-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tw-video-cover { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #e9e2d4; }
.tw-video-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tw-play-ico {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; font-style: normal; text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
  background: linear-gradient(180deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .18));
}
.tw-duration {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; font-style: normal;
}
.tw-video-title {
  font-size: 12.5px; font-weight: 600; color: #1C1915; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tw-video-meta { font-size: 11px; color: #9C9384; }

/* 播放页 */
.tw-play-page { margin-bottom: 12px; }

/* 短视频竖屏流 */
.tw-shorts {
  height: calc(100dvh - 128px);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  border-radius: 14px;
  background: #0d0d10;
  margin: 0 0 10px;
}
.tw-short { position: relative; height: 100%; scroll-snap-align: start; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #000; }
.tw-short-media { position: absolute; inset: 0; }
.tw-short-media img, .tw-short-media video { width: 100%; height: 100%; object-fit: cover; }
.tw-short-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: transparent; }
.tw-short-info { position: absolute; left: 14px; right: 76px; bottom: 24px; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .65); z-index: 2; }
.tw-short-info h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.4; }
.tw-short-info p { margin: 0; font-size: 11px; opacity: .86; }
.tw-short-like {
  position: absolute; right: 12px; bottom: 24px; z-index: 2;
  border: 0; padding: 8px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 12px; backdrop-filter: blur(6px);
}
.tw-short-like.is-on { color: #ff4d6d; }

/* 小说列表 */
.tw-novel-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.tw-novel-card { display: flex; gap: 10px; padding: 10px; background: #fff; border: 1px solid #f1ede3; border-radius: 14px; align-items: center; }
.tw-novel-cover { flex: 0 0 64px; width: 64px; height: 88px; border-radius: 8px; overflow: hidden; background: #efe8db; }
.tw-novel-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tw-novel-info { flex: 1; min-width: 0; }
.tw-novel-info strong { display: block; font-size: 14px; color: #1C1915; }
.tw-novel-info em { display: block; font-style: normal; font-size: 11px; color: #9C9384; margin: 3px 0; }
.tw-novel-info p { margin: 0; font-size: 11.5px; color: #6E675A; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tw-novel-go { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; background: linear-gradient(135deg, #EECD82, #C79A3E); color: #fff; font-size: 12px; }

/* 章节列表 */
.tw-chapters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.tw-chapter-item { display: flex; gap: 6px; align-items: center; padding: 7px 9px; border-radius: 9px; background: #faf7f0; font-size: 12px; color: #57503F; }
.tw-chapter-item.is-active { background: #f4e6c3; color: #6b5a2f; font-weight: 700; }
.tw-chapter-idx { color: #9C9384; font-size: 10px; }
.tw-chapter-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 播放器 */
.tw-player { position: relative; margin: 6px 0 12px; border-radius: 14px; overflow: hidden; background: #000; }
.tw-player-video { width: 100%; max-height: 66vh; display: block; background: #000; }
.tw-player-iframe { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; margin: 6px 0 12px; }
.tw-player-iframe iframe { width: 100%; height: 100%; border: 0; }
.tw-player-empty { padding: 40px 16px; text-align: center; color: #9C9384; background: #fff; border-radius: 14px; }

/* 图标尺寸兜底（不同 tab 下 home.css 规则不一致） */
.home-ui-icon { width: 20px !important; height: 20px !important; min-width: 20px; min-height: 20px; display: block; flex: 0 0 auto; fill: currentColor; }
.bottom-nav .nav-ico { width: 32px; height: 32px; flex: 0 0 32px; display: flex; align-items: center; justify-content: center; }
.bottom-nav .nav-ico .home-ui-icon { width: 20px !important; height: 20px !important; }
.home-appbar .search-ico .home-ui-icon, .home-appbar .round-action .home-ui-icon { width: 18px !important; height: 18px !important; }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; }
.nav-item em { font-style: normal; font-size: 10px; line-height: 1.2; }

.tw-pager-dots { color: #9C9384; padding: 5px 4px; font-size: 12px; }


/* 隐藏 Remix 字体伪元素（字体未加载时显示为方框），统一使用 SVG 图标 */
.nav-ico:before, .search-ico:before, .round-action:before, .text-btn:after,
.nav-item .nav-ico:before, .home-appbar .search-ico:before, .home-appbar .round-action:before {
  content: none !important;
  display: none !important;
}

/* 短视频页布局修正：避免与 tabbar 重叠、首屏占满 */
.tw-shorts {
  height: calc(100dvh - 150px);
  min-height: 420px;
  scroll-snap-type: y mandatory;
  border-radius: 14px;
  margin: 0 0 6px;
}
.mobile-app.is-tab-short .tw-copyright { display: none; }
.mobile-app.is-tab-short .page-main { padding-bottom: 4px; }
.tw-short-info { bottom: 34px; }
.tw-short-like { bottom: 34px; }
.tw-short-media::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 38%;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  pointer-events: none;
}

/* 底部导航背景（home.css 中被置为透明，这里强制浅色毛玻璃） */
.bottom-nav {
  background: rgba(250, 247, 240, .97) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid #efe9dc;
  z-index: 60 !important;
}
.nav-item { color: #8a8172; }
.nav-item.is-active { color: #1C1915; background: rgba(212, 168, 90, .16); border-radius: 12px; }

/* ===== 顶部固定公告栏 ===== */
.tw-site-head { position: sticky; top: 0; z-index: 45; }
.tw-site-head .home-appbar { position: static; top: auto; }
.top-notice {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 12px;
  background: var(--notice-bg, #E11D48);
  color: var(--notice-fg, #fff);
  font-size: 12px; font-weight: 800; letter-spacing: .2px;
  line-height: 1.4; text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  word-break: break-word;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.top-notice .n-ico { flex: 0 0 auto; font-size: 13px; line-height: 1; }
.top-notice .n-text { min-width: 0; }
a.top-notice { text-decoration: none; }
a.top-notice:hover { filter: brightness(1.05); }
