:root { color-scheme: light dark; }
* { box-sizing: border-box; }

/* 背景图片（进入详情页隐藏，返回搜索恢复） */
.home-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
}
.home-bg[hidden] { display: none; }
.bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.page { position: relative; z-index: 1; }

/* 顶部横幅（毛玻璃） */
.masthead {
  position: relative;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 10px;
  background: rgba(255,255,255,.22);
  background: linear-gradient(135deg, rgba(255,255,255,.30), rgba(255,255,255,.08) 55%, rgba(255,255,255,.18));
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
}
@media (prefers-color-scheme: dark) {
  .masthead {
    border-color: rgba(255,255,255,.18);
    background: rgba(17,19,24,.26);
    background: linear-gradient(135deg, rgba(17,19,24,.34), rgba(17,19,24,.10) 55%, rgba(17,19,24,.22));
  }
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  max-width: 900px; margin: 0 auto; padding: 24px 16px; line-height: 1.5;
}
h1 { font-size: 22px; margin: 0 0 4px; }
.sources { color: #888; font-size: 13px; margin-bottom: 18px; }

/* 搜索框（毛玻璃） */
.search {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 10px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
input[type=text], input.url {
  flex: 1; padding: 10px 12px; font-size: 15px;
  border: 1px solid #ccc; border-radius: 6px; background: transparent; color: inherit;
}
button { cursor: pointer; }
button.search-btn {
  padding: 10px 20px; font-size: 15px; border: none; border-radius: 6px;
  background: #2563eb; color: #fff;
}
button.search-btn:hover { background: #1d4ed8; }

/* 数据源多选（毛玻璃） */
.source-select {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 10px;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.source-label { color: #888; font-size: 14px; line-height: 30px; flex-shrink: 0; }
.source-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.source-check { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: inherit; cursor: pointer; }
.source-check input { cursor: pointer; }

/* 结果卡片 */
.card {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid rgba(128,128,128,.25); border-radius: 8px;
  padding: 10px; margin-bottom: 12px; cursor: pointer;
  transition: background .15s;
}
.card:hover { background: rgba(128,128,128,.08); }
.cover { width: 84px; height: 112px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #ddd; }
.cover.placeholder, .cover-lg.placeholder {
  display: flex; align-items: center; justify-content: center; color: #999; font-size: 12px;
}
.card .info { flex: 1; min-width: 0; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.meta { color: #888; font-size: 13px; font-weight: normal; }
.source-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: inherit;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  vertical-align: middle;
}
.card h3 .source-badge { margin-left: 8px; }
.detail-info .source-badge { margin-left: 8px; }
.desc { font-size: 14px; color: #666; margin-top: 6px; }
.empty { color: #999; padding: 20px 0; }

/* 分页条（毛玻璃） */
.pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 16px; }
.pager button {
  padding: 8px 16px; font-size: 14px; border: 1px solid #ccc; border-radius: 6px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: inherit; cursor: pointer;
}
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager button:not(:disabled):hover { background: rgba(255,255,255,.26); border-color: rgba(255,255,255,.5); }
.pager .page-info { color: #888; font-size: 14px; min-width: 120px; text-align: center; }

/* 详情 */
.back {
  margin-bottom: 14px; padding: 8px 14px; font-size: 14px;
  border: 1px solid #ccc; border-radius: 6px; background: transparent; color: inherit;
}
.detail-head { display: flex; gap: 16px; margin-bottom: 20px; }
.cover-lg { width: 150px; height: 200px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #ddd; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h2 { margin: 0 0 8px; font-size: 20px; }
.detail-info .meta { margin-bottom: 10px; }

.eps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ep {
  padding: 8px 12px; font-size: 14px; border: 1px solid #ccc; border-radius: 6px;
  background: transparent; color: inherit; min-width: 56px; text-align: center;
}
.ep:hover { background: rgba(37,99,235,.12); border-color: #2563eb; }

/* 播放器 */
.play { margin-top: 20px; padding: 14px; border: 1px solid rgba(128,128,128,.25); border-radius: 8px; }
.play .meta { margin-bottom: 8px; }
.player-video { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 8px; }
.player-placeholder {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16/9; background: #000; border-radius: 8px; color: #aaa;
  font-size: 14px;
}
.hint { color: #888; font-size: 12px; margin-top: 8px; }

/* 播放方式切换按钮（原生直连 / 去广告播放） */
.mode-btn {
  margin-left: 8px;
  padding: 4px 12px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 999px;
  background: transparent;
  color: inherit;
}
.mode-btn:hover { border-color: #2563eb; color: #2563eb; }
.mode-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
