.direct-link-ad-banner{background:linear-gradient(90deg,#0e1628 0%,#132120 55%,#1b2d21 100%);border:1px solid #ffffff1a;border-radius:14px;justify-content:space-between;align-items:center;gap:16px;width:100%;margin-bottom:24px;padding:14px 20px;text-decoration:none;transition:border-color .2s,box-shadow .2s,transform .2s;display:flex;box-shadow:0 4px 16px #00000040}.watch-main>.direct-link-ad-banner{margin-top:20px;margin-bottom:24px}.direct-link-ad-banner:hover{border-color:#ffffff38;transform:translateY(-1px);box-shadow:0 8px 24px #00000059}.direct-link-ad-banner__content{flex-direction:column;gap:3px;min-width:0;display:flex}.direct-link-ad-banner__eyebrow{color:#38bdf8;letter-spacing:.06em;font-size:11px;font-weight:700}.direct-link-ad-banner__title{color:#fff;text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:700;line-height:1.4;overflow:hidden}.direct-link-ad-banner__button{color:#0a0a0b;white-space:nowrap;background:#cf0;border-radius:10px;flex:none;align-items:center;gap:6px;padding:8px 16px;font-size:13px;font-weight:700;transition:background-color .2s,transform .15s;display:inline-flex}.direct-link-ad-banner:hover .direct-link-ad-banner__button{background:#d8ff33;transform:scale(1.02)}@media (width<=640px){.direct-link-ad-banner{gap:12px;margin-bottom:18px;padding:12px 14px}.direct-link-ad-banner__title{white-space:normal;font-size:13px}.direct-link-ad-banner__button{border-radius:8px;padding:6px 12px;font-size:12px}}

/* =========================================================================
 * ZIP0 本地纯影视版 · 界面补丁
 * 由 app/server.js 在返回任意 CSS 时自动追加到末尾。
 * 目标：移除登录/游戏/广播/音乐/广告/评论/收藏/下载等非纯影视元素，
 *       并让页面布局在移除推广模块后仍然协调。
 * ========================================================================= */

/* ---------- 1. 登录 / 账户 / PWA 安装 ---------- */
.auth-login-button,
.auth-control,
.auth-dialog,
.auth-google-button,
.pwa-install-button {
  display: none !important;
}

/* ---------- 2. 游戏 / 广播 / 音乐入口（桌面、移动菜单、下拉）---------- */
.site-nav a[href="/games"],
.site-nav a[href^="/game/"],
.site-nav a[href="/radio"],
.site-nav a[href="/music"],
.site-nav a[href="/watch-music"],
.site-nav a[href="/watch-radio"],
.mobile-menu__nav a[href="/games"],
.mobile-menu__nav a[href="/radio"],
.mobile-menu__nav a[href="/music"],
.mobile-menu__nav a[href="/watch-music"],
.mobile-menu__nav a[href="/watch-radio"],
.site-nav__dropdown:has(a[href="/music"]),
.site-nav__dropdown:has(a[href="/radio"]) {
  display: none !important;
}

/* ---------- 3. 推广 / 广告 / 游戏推荐 ---------- */
.hero-games,
.hero-share-earnings,
.watch-games,
.direct-link-ad-banner,
.player-state-ad {
  display: none !important;
}

/* 移除首页 hero 右侧的推广卡片后，右侧区域改由本地“继续观看/快捷发现”面板承担 */
.hero__spotlight-stack {
  display: none !important;
}

/* ---------- 4. 需要登录的交互：收藏 / 评论 / 下载 / 创建收藏夹 ---------- */
.favorite-btn,
.download-entry,
.video-comments,
.featured-collections__create {
  display: none !important;
}

/* ---------- 5. 弹幕：只保留观看，关闭发送（避免向线上写入内容）---------- */
.danmaku-input,
.danmaku-send {
  display: none !important;
}
.danmaku-controls {
  margin-right: 6px;
}

/* ---------- 6. 页脚精简：只保留关于 / 隐私 / 条款 ---------- */
.site-footer__links a[href="/share-earnings"],
.site-footer__links a[href="/contact"],
.site-footer__links a[href*="openapi"],
.site-footer__links a[href="/download"] {
  display: none !important;
}

/* ---------- 7. 收藏详情页：只保留“影视”分类页签 ---------- */
.favorites-tabs button:nth-child(n + 2) {
  display: none !important;
}

/* ---------- 8. 其它登录提示 ---------- */
.empty-state .button--primary[href*="login"],
[class*="login-prompt"],
[class*="login-guard"] {
  display: none !important;
}

/* =========================================================================
 * 9. 首页 hero 本地面板（由 patch/enhance.js 注入）
 *    - 有观看历史时显示“继续观看”
 *    - 没有历史时显示“快捷发现”（分类 + 热门搜索）
 * ========================================================================= */
.hero__content:has(.hero-local-panel) {
  grid-template-columns: minmax(0, 1fr) 380px !important;
  align-items: center;
}

.hero-local-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(160deg, #ffffff0d, transparent 55%),
    var(--panel);
  box-shadow: 0 24px 60px #0000004d;
  backdrop-filter: blur(6px);
}

.hero-local-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.hero-local-panel__head .eyebrow {
  margin: 0;
}
.hero-local-panel__head strong {
  font-size: 18px;
  letter-spacing: 0.01em;
}
/* 继续观看：eyebrow 单独一行，标题与清除按钮同一行 */
.hero-local-panel__head--continue {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.hero-local-panel__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hero-local-panel__title-row strong {
  font-size: 20px;
  font-weight: 650;
}
.hero-local-panel__title-row .hero-local-panel__clear {
  flex: none;
}
.hero-local-panel__clear {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
}
.hero-local-panel__clear:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.hero-local-panel__list {
  display: grid;
  gap: 10px;
}

.hero-local-item {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elevated);
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.hero-local-item:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.hero-local-item__poster {
  display: block;
  width: 54px;
  height: 76px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--panel-soft);
}
.hero-local-item__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-local-item__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding-bottom: 8px;
}
.hero-local-item__meta strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-local-item__meta span {
  color: var(--muted);
  font-size: 12px;
}

.hero-local-item__bar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 3px;
  border-radius: 999px;
  background: #ffffff1a;
  overflow: hidden;
}
.hero-local-item__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.hero-local-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-local-panel__chips a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-light);
  font-size: 13px;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.hero-local-panel__chips a:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--panel-soft);
}
.hero-local-panel__chips a.is-accent {
  color: var(--accent);
  border-color: #c6f36b40;
  background: var(--accent-soft);
}

.hero-local-panel__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero-local-panel__label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .hero__content:has(.hero-local-panel) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .hero-local-panel {
    display: none;
  }
}

/* =========================================================================
 * 10. 其它细节
 * ========================================================================= */
/* 首页“接着上次看”区块若无内容，其外框留白自然收起 */
.recent-card__poster img {
  object-fit: cover;
}
/* 收藏详情页只保留影视列表 */
.favorites-type-tabs button:not(:first-child) {
  display: none !important;
}

/* =========================================================================
 * 11. 本地说说（续播提示）
 * ========================================================================= */
.local-toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 9999;
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #151517f2;
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 16px 40px #00000073;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.local-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 12. 线路测速：隐藏环境相关的“连接异常”徽标，保留可用线路延迟 ---------- */
.speed-badge--error {
  display: none !important;
}

/* =========================================================================
 * 13. 品牌重命名：西米影视库（隐藏原站“0”图标，字标改为纯文字）
 * ========================================================================= */
.brand__counter {
  display: none !important;
}
.brand {
  letter-spacing: 0.01em !important;
}
.brand__letters,
.brand__domain {
  letter-spacing: 0.02em !important;
}
.brand__visual {
  gap: 0 !important;
}

/* 品牌字标前的小图标（纯 CSS 伪元素，不参与 React 水合） */
.brand .brand__visual::before {
  content: "";
  flex: none;
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.24em;
  border-radius: 50%;
  background: url("/logo.png?v=20261022-header-logo") center / contain no-repeat !important;
}

/* 按完整语意分行；字号随屏幕调整，避免标题和说明被挤成零碎短句。 */
.hero h1 {
  font-size: clamp(30px, 5.2vw, 64px);
  line-height: 1.18;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.hero h1 em {
  display: block;
}
.hero__copy > p {
  max-width: 100%;
  white-space: pre-line;
  text-wrap: stable;
  font-size: clamp(12px, 3.5vw, 17px);
}

/* 搜索先展示影片；线路和筛选保留可展开的摘要。分类页不折叠筛选。 */
.search-page:has(.search-filters-panel) .search-page__top {
  margin-bottom: 20px;
  gap: 24px;
}
.search-page:has(.search-filters-panel) .source-health {
  margin-bottom: 10px;
}
.source-health summary::after {
  content: "⌄";
  color: var(--muted);
  flex: none;
}
.source-health summary > span:nth-child(2) {
  margin-left: auto;
}
.source-health[open] summary::after {
  transform: rotate(180deg);
}
.search-filters-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff06;
  margin-bottom: 24px;
  overflow: hidden;
}
.search-filters-panel > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.search-filters-panel > summary::-webkit-details-marker {
  display: none;
}
.search-filters-panel > summary > span:nth-child(2) {
  margin-left: auto;
  color: var(--muted-light);
  font-size: 12px;
}
.search-filters-panel[open] .local-disclosure {
  transform: rotate(180deg);
}
.search-filters-panel .search-filters {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 0;
  background: transparent;
}
.search-filters-panel .search-filter-row {
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 8px 12px;
  gap: 8px;
}
.search-filters-panel .search-filter-row button {
  min-height: 36px;
}
.search-filters-panel summary:focus-visible,
.source-health summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}
.local-content-kind {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 4px 8px;
  border: 1px solid #ffffff29;
  border-radius: 7px;
  background: #111111e6;
  color: var(--text);
  font-size: 11px;
  line-height: 1.3;
  pointer-events: none;
}
@media (max-width: 620px) {
  .search-page:has(.search-filters-panel) .search-page__top {
    gap: 16px;
    margin-bottom: 18px;
  }
  .search-page:has(.search-filters-panel) .source-health summary {
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding-right: 34px;
  }
  .search-page:has(.search-filters-panel) .source-health summary > span:nth-child(2) {
    flex: 1 1 auto;
    text-align: right;
    font-size: 11px;
  }
  .search-page:has(.search-filters-panel) .source-health summary::after {
    position: absolute;
    right: 14px;
    top: 17px;
  }
  .search-filters-panel .search-filter-row {
    padding: 8px;
    gap: 4px;
  }
  .search-filters-panel .search-filter-row button {
    min-height: 40px;
    padding-inline: 9px;
  }
}
