:root {
  --bg: #0e1015;
  --panel: #161a22;
  --line: #242a36;
  --text: #e6e9ef;
  --muted: #8a93a3;
  --brand: #ff5c5c;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: rgba(14,16,21,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.logo { font-size: 18px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.search { flex: 1; display: flex; }
.search input {
  width: 100%; max-width: 420px; padding: 8px 14px; border-radius: 20px;
  border: 1px solid var(--line); background: #0b0d12; color: var(--text); outline: none;
}
.search input:focus { border-color: var(--brand); }
.stat { color: var(--muted); font-size: 13px; white-space: nowrap; }

.cats { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 0; }
.cats button {
  padding: 6px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); cursor: pointer; font-size: 13px;
}
.cats button.on, .cats button:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

main { padding: 18px 20px 40px; }
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.card { display: block; }
.thumb {
  position: relative; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute; left: 6px; bottom: 6px; font-size: 11px; padding: 1px 6px;
  border-radius: 4px; background: rgba(255,92,92,.9); color: #fff;
}
.badge.mp4 { background: rgba(60,140,255,.9); }
.card .t {
  margin: 6px 2px 0; font-size: 13px; line-height: 1.4; height: 2.8em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card:hover .t { color: var(--brand); }

.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 24px; }
.pager button {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); cursor: pointer;
}
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button[disabled] { opacity: .45; cursor: default; }
.pager .gap { padding: 6px 4px; color: var(--muted); border: none; background: none; cursor: default; }

/* 分页控制条：每页数量 + 页码跳转 */
.pagerbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  margin-top: 24px; padding: 10px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.pagerbar .psize, .pagerbar .pjump { display: inline-flex; align-items: center; gap: 6px; }
.pagerbar .pjump { margin-left: auto; }
.pagerbar select, .pagerbar input {
  padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line);
  background: #0b0d12; color: var(--text); font-size: 13px; outline: none;
}
.pagerbar input { width: 68px; text-align: center; }
.pagerbar select:focus, .pagerbar input:focus { border-color: var(--brand); }
.pagerbar button {
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line);
  background: #202634; color: var(--text); cursor: pointer; font-size: 13px;
}
.pagerbar button:hover { border-color: var(--brand); color: #fff; background: var(--brand); }
.pagerbar .pinfo { color: var(--text); }

@media (max-width: 600px) {
  .pagerbar { gap: 10px; }
  .pagerbar .pjump { margin-left: 0; }
}

/* 访问密码门：未通过时隐藏页面其它内容 */
html.locked body > *:not(.gate) { display: none !important; }
html.locked { background: var(--bg); }
.gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.gatebox {
  width: 100%; max-width: 340px; text-align: center;
  padding: 32px 26px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
}
.gatelock { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.gatebox h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.gatehint { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.gatebox input {
  width: 100%; padding: 10px 14px; margin-bottom: 10px;
  border-radius: 8px; border: 1px solid var(--line);
  background: #0b0d12; color: var(--text); font-size: 15px; outline: none;
  box-sizing: border-box;
}
.gatebox input:focus { border-color: var(--brand); }
.gatebox button {
  width: 100%; padding: 10px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--brand); background: var(--brand); color: #fff; font-size: 15px;
}
.gatebox button:hover { filter: brightness(1.1); }
.gatebox button:disabled { opacity: .6; cursor: default; }
.gateerr { margin: 12px 0 0; font-size: 13px; color: #ff8080; }

.loading, .empty { padding: 40px; text-align: center; color: var(--muted); }

.playwrap { max-width: 960px; margin: 0 auto; }
.playerbox {
  position: relative; background: #000; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
}
#v { width: 100%; aspect-ratio: 16/9; display: block; background: #000; }
/* 提示条：只占播放器顶部一条，不覆盖画面、不挡 controls */
.tip {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  padding: 10px 14px; font-size: 13px; line-height: 1.7;
  color: #ffd7d7; background: rgba(120, 20, 20, .92);
  border-bottom: 1px solid rgba(255,255,255,.15);
  pointer-events: auto;
}
/* 自定义控制条：集成在播放器内部（覆盖在画面底部），全屏时一起进入全屏 */
.playerbox.isfs { border-radius: 0; border: none; }
.playerbox.idle { cursor: none; }
.vbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 18px 12px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,.4) 55%, rgba(0,0,0,0));
  opacity: 1; transition: opacity .25s;
}
.playerbox.idle .vbar { opacity: 0; pointer-events: none; }

/* 进度条：点击/拖动跳转 */
.bar {
  position: relative; height: 6px; border-radius: 3px; cursor: pointer;
  background: rgba(255,255,255,.24); transition: height .12s;
}
.vbar:hover .bar { height: 8px; }
.barbuf { position: absolute; left: 0; top: 0; bottom: 0; width: 0;
          border-radius: 3px; background: rgba(255,255,255,.32); }
.barfill { position: absolute; left: 0; top: 0; bottom: 0; width: 0;
           border-radius: 3px; background: var(--brand); }
.barhandle { position: absolute; top: 50%; left: 0; width: 12px; height: 12px;
             margin: -6px 0 0 -6px; border-radius: 50%; background: #fff;
             box-shadow: 0 0 4px rgba(0,0,0,.7); }

/* 按钮行 */
.vrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.vrow .spacer { flex: 1; }
.vbtn {
  padding: 5px 10px; font-size: 14px; line-height: 1; cursor: pointer;
  color: #fff; background: transparent; border: none; border-radius: 6px;
  transition: background .15s;
}
.vbtn:hover { background: rgba(255,255,255,.16); }
.vbtn:active { transform: translateY(1px); }
.vbtn.primary { background: var(--brand); }
.vbtn.primary:hover { background: var(--brand); filter: brightness(1.12); }
.vtime { font-size: 12px; color: #dfe3ea; font-variant-numeric: tabular-nums;
         white-space: nowrap; padding: 0 2px; }
.vhint { font-size: 11px; color: rgba(255,255,255,.55); }
.vol { width: 76px; accent-color: var(--brand); cursor: pointer; }
.vol:focus { outline: none; }

/* 快进/后退时的短暂提示，pointer-events:none 保证绝不挡住任何控件 */
.seekflash {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 10px 18px; border-radius: 10px; font-size: 20px; font-weight: 600;
  color: #fff; background: rgba(0,0,0,.72);
  opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 4;
}
.seekflash.show { opacity: 1; }

@media (max-width: 600px) {
  .vhint { display: none; }
  .vol { display: none; }
  .vbtn { padding: 5px 8px; font-size: 13px; }
}

.playtitle { font-size: 20px; margin: 18px 0 6px; }
.meta { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.desc { color: #c2c8d4; font-size: 14px; margin: 0 0 8px; }
.src a { color: var(--brand); font-size: 13px; }
.sec { font-size: 16px; margin: 28px 0 12px; padding-left: 8px; border-left: 3px solid var(--brand); }

.foot {
  padding: 20px; text-align: center; color: #5c6470; font-size: 12px;
  border-top: 1px solid var(--line);
}
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .topbar { gap: 10px; padding: 10px 12px; }
  main { padding: 14px 12px 30px; }
}
