/* ============ VIP影视聚合搜索 H5 ============ */
:root {
  --bg: #0f1115;
  --bg2: #171a21;
  --bg3: #1f2430;
  --text: #e8eaf0;
  --muted: #8b93a5;
  --primary: #4f8cff;
  --primary-dark: #3a6fe0;
  --danger: #e05a5a;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; padding: 16px 0 32px; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 14px; width: 100%; }
a { color: inherit; text-decoration: none; }
code { background: var(--bg3); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 顶部 ---------- */
.site-header {
  background: var(--bg2); border-bottom: 1px solid #262c3a;
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 56px; }
.logo { font-size: 18px; font-weight: 700; white-space: nowrap; color: #fff; }
.header-search { display: flex; flex: 1; max-width: 480px; margin-left: auto; }
.header-search input {
  flex: 1; border: 1px solid #2c3345; border-right: none;
  background: var(--bg3); color: var(--text);
  padding: 8px 12px; border-radius: 8px 0 0 8px; outline: none; min-width: 0;
}
.header-search button {
  border: none; background: var(--primary); color: #fff;
  padding: 0 16px; border-radius: 0 8px 8px 0; cursor: pointer;
}

/* 搜索建议下拉 */
.suggest-box {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg2); border: 1px solid #2c3345; border-radius: 8px;
  margin-top: 6px; overflow: hidden; z-index: 99;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.suggest-box a { display: block; padding: 8px 12px; font-size: 14px; }
.suggest-box a:hover { background: var(--bg3); color: var(--primary); }
.header-search, .hero-search { position: relative; }

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 56px 0 30px; }
.hero h1 { font-size: 30px; letter-spacing: 1px; }
.hero .sub { color: var(--muted); margin: 10px 0 26px; }
.hero-search {
  display: flex; max-width: 620px; margin: 0 auto;
  border: 2px solid var(--primary); border-radius: 12px; overflow: hidden;
  background: var(--bg3);
}
.hero-search input {
  flex: 1; border: none; background: transparent; color: var(--text);
  padding: 13px 16px; font-size: 16px; outline: none; min-width: 0;
}
.hero-search button {
  border: none; background: var(--primary); color: #fff;
  padding: 0 30px; font-size: 16px; cursor: pointer;
}
.hero-search button:active { background: var(--primary-dark); }
.hot-kw { margin-top: 18px; font-size: 13px; color: var(--muted); }
.hot-kw-label { margin-right: 4px; }
.hot-kw a {
  display: inline-block; margin: 4px 5px; padding: 4px 12px;
  background: var(--bg3); border-radius: 999px; color: var(--text);
}
.hot-kw a:hover { color: var(--primary); }

.section { margin-top: 34px; }
.section-title { font-size: 18px; margin-bottom: 14px; }
.video-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.video-card { display: block; }
.video-cover {
  position: relative; padding-top: 133%; border-radius: var(--radius);
  overflow: hidden; background: linear-gradient(135deg, #232a3a, #171c28);
}
.video-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.cover-fallback {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  font-size: 44px; font-weight: 700; color: #3d4863;
}
.video-title {
  margin-top: 8px; font-size: 14px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.badge {
  position: absolute; left: 6px; top: 6px; z-index: 2;
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  color: #fff; background: #5a6478; backdrop-filter: blur(4px);
}
.badge.p-iqiyi { background: #1e9e46; }
.badge.p-qq    { background: #e8703a; }
.badge.p-youku { background: #1f7ae0; }
.badge.p-mgtv  { background: #f08519; }
.badge.p-bili  { background: #ec6a9c; }
.badge.p-sohu  { background: #e0b13a; color: #333; }
.badge.p-le    { background: #d43a3a; }

/* ---------- 搜索结果 ---------- */
.search-summary h1 { font-size: 20px; margin: 6px 0; }
.search-summary small { color: var(--muted); font-weight: 400; }
.blocked-box {
  background: #2a1d20; border: 1px solid #5a3038;
  padding: 22px; border-radius: var(--radius); margin-top: 14px; text-align: center;
}
.platform-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 0;
  -webkit-overflow-scrolling: touch;
}
.platform-tabs a {
  flex-shrink: 0; padding: 6px 16px; border-radius: 999px;
  background: var(--bg3); font-size: 13px; color: var(--muted);
}
.platform-tabs a.active { background: var(--primary); color: #fff; }
.result-list { display: flex; flex-direction: column; gap: 12px; }
.result-item {
  display: flex; gap: 12px; background: var(--bg2);
  border: 1px solid #262c3a; border-radius: var(--radius); padding: 12px;
}
.result-cover {
  position: relative; width: 96px; min-width: 96px; height: 128px;
  border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, #232a3a, #171c28);
}
.result-cover img { width: 100%; height: 100%; object-fit: cover; }
.result-cover .cover-fallback {
  display: none; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 700; color: #3d4863;
}
.result-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result-title {
  font-size: 16px; font-weight: 600; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.result-title:visited { color: #b9a7e0; }
.result-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--muted); font-size: 13px; margin-bottom: auto;
}
.result-meta .badge { position: static; }
.result-actions { display: flex; gap: 10px; margin-top: 10px; }
.btn {
  display: inline-block; border: none; cursor: pointer; text-align: center;
  padding: 8px 18px; border-radius: 8px; font-size: 14px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-ghost { background: transparent; border: 1px solid #39415a; color: var(--muted); }
.empty-box { text-align: center; padding: 60px 0; color: var(--muted); }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 24px; flex-wrap: wrap; }
.pagination a {
  min-width: 36px; text-align: center; padding: 7px 12px;
  background: var(--bg3); border-radius: 8px; font-size: 14px;
}
.pagination a.active { background: var(--primary); color: #fff; }

/* ---------- 播放页 ---------- */
.play-page { max-width: 900px; margin: 0 auto; }
.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; }
.player-box {
  position: relative; padding-top: 56.25%;
}
.player-box iframe, .player-box video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none;
  background: #000;
}
.player-tip {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 14px;
  pointer-events: none; padding: 20px; text-align: center;
}
.player-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 0;
}
.line-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.line-tabs button {
  border: 1px solid #39415a; background: var(--bg3); color: var(--muted);
  padding: 6px 16px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.line-tabs button.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.player-tools { margin-left: auto; display: flex; gap: 8px; }
.player-tools button {
  border: 1px solid #39415a; background: var(--bg3); color: var(--text);
  padding: 6px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.player-note { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.play-info h1 { font-size: 20px; margin: 14px 0 8px; }
.play-info .result-meta .badge { position: static; }
.source-list { display: flex; gap: 10px; flex-wrap: wrap; }
.source-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid #262c3a;
  padding: 8px 14px; border-radius: 8px; font-size: 14px;
}
.source-item .badge { position: static; }
.source-item:hover { border-color: var(--primary); }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid #262c3a; padding: 18px 0 24px;
  color: var(--muted); font-size: 12px; text-align: center; line-height: 1.9;
}

/* ---------- 管理后台 ---------- */
.admin-body { background: #f4f6fa; color: #23293a; }
.admin-body .container { max-width: 1200px; }
.admin-header { background: #1c2233; }
.admin-header .logo { color: #fff; font-size: 16px; }
.admin-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.admin-nav a { color: #c6cddb; padding: 6px 12px; border-radius: 6px; font-size: 14px; }
.admin-nav a:hover { background: #2a3350; color: #fff; }
.page-title { font-size: 22px; margin: 18px 0 14px; }
.flash {
  background: #e3f0e3; border: 1px solid #9fc99f; color: #2a5a2a;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px;
}
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card {
  background: #fff; border-radius: 12px; padding: 18px; text-align: center;
  box-shadow: 0 1px 4px rgba(20,30,60,.08);
}
.stat-card b { font-size: 28px; display: block; color: #2b57d8; }
.stat-card span { color: #7a8296; font-size: 13px; }
.panel {
  background: #fff; border-radius: 12px; padding: 18px; margin-top: 16px;
  box-shadow: 0 1px 4px rgba(20,30,60,.08);
}
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef0f5; }
th { color: #7a8296; font-weight: 500; font-size: 13px; }
.admin-table tr:hover > td { background: #f8f9fc; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bars { flex: 1; display: flex; align-items: flex-end; gap: 4px; width: 100%; justify-content: center; }
.bar { width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-s { background: #5b8def; }
.bar-p { background: #f0a44a; }
.chart-label { font-size: 12px; color: #7a8296; margin-top: 6px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input {
  border: 1px solid #d7dce8; border-radius: 8px; padding: 8px 12px; font-size: 14px;
  min-width: 220px;
}
.rule-form {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: #f7f8fb; padding: 10px; border-radius: 8px;
}
.rule-form label { display: flex; flex-direction: column; font-size: 12px; color: #7a8296; gap: 3px; }
.rule-form label.chk { flex-direction: row; align-items: center; gap: 5px; }
.rule-form input, .rule-form select {
  border: 1px solid #d7dce8; border-radius: 6px; padding: 6px 8px; font-size: 13px;
  width: 150px;
}
.rule-form label.grow { flex: 1; min-width: 240px; }
.rule-form label.grow input { width: 100%; }
.rule-row td { background: #fbfcfe; }
.ops { display: flex; gap: 6px; }
.ops form { display: inline; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-danger { background: #fbe9e9; color: #c0392b; }
.note-cell, .url-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.kw-list { display: flex; gap: 8px; flex-wrap: wrap; }
.kw-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f1f3f8; border-radius: 999px; padding: 5px 6px 5px 14px; font-size: 13px;
}
.kw-item button {
  border: none; background: #dfe3ec; width: 20px; height: 20px; border-radius: 50%;
  cursor: pointer; line-height: 1; color: #666;
}
.kw-item button:hover { background: #f5c6c6; }
.login-card {
  max-width: 360px; margin: 80px auto; background: #fff; border-radius: 14px;
  padding: 30px; box-shadow: 0 8px 30px rgba(20,30,60,.12);
}
.login-card h1 { font-size: 18px; text-align: center; margin-bottom: 20px; }
.login-card label { display: block; font-size: 13px; color: #7a8296; margin-bottom: 14px; }
.login-card input {
  width: 100%; border: 1px solid #d7dce8; border-radius: 8px;
  padding: 10px 12px; font-size: 15px; margin-top: 4px;
}
.btn-block { width: 100%; padding: 11px; font-size: 15px; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 640px) {
  .hero { padding: 34px 0 20px; }
  .hero h1 { font-size: 23px; }
  .header-inner { gap: 8px; }
  .logo { font-size: 15px; }
  .header-search input { padding: 7px 10px; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .result-cover { width: 78px; min-width: 78px; height: 104px; }
  .result-item { padding: 10px; }
  .result-actions .btn { padding: 7px 12px; font-size: 13px; }
  .hero-search button { padding: 0 18px; }
  .admin-nav { display: none; }
}
