:root {
  --bg: #101010;
  --panel: #181818;
  --border: #262626;
  --text: #e8e8e8;
  --muted: #9a9a9a;
  --accent: #ff5c39;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

.topbar {
  position: sticky;
  top: 0;
  background: rgba(20, 20, 20, 0.95);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  backdrop-filter: blur(6px);
}
.topbar-in { display: flex; align-items: center; gap: 16px; height: 56px; }
.logo { font-weight: 800; font-size: 20px; color: var(--accent); letter-spacing: 0.3px; white-space: nowrap; }
.search { flex: 1; display: flex; max-width: 640px; }
.search input {
  flex: 1;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-right: 0;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px 0 0 6px;
  outline: none;
  min-width: 0;
}
.search button {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 0 18px;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-weight: 600;
}
.topnav { display: flex; gap: 14px; margin-left: auto; }
.topnav a { color: var(--muted); font-weight: 500; padding: 6px 2px; white-space: nowrap; }
.topnav a:hover { color: var(--text); }

.section-title { font-size: 18px; margin: 20px 0 12px; }
.home-head { display: flex; align-items: baseline; gap: 12px; }
.home-head .count { color: var(--muted); font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.grid-compact { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.card:hover { border-color: #3d3d3d; }
.thumb { position: relative; display: block; padding-top: 56.25%; background: #000; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.dur {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.hover-ad { display: none; position: absolute; inset: 0; z-index: 5; background: rgba(0, 0, 0, 0.9); padding: 8px; }
.card:hover .hover-ad { display: block; }
.card-meta { padding: 8px 10px 10px; }
.card-title {
  display: block;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
}
.card-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 24px 0; justify-content: center; }
.pagination a, .pagination span {
  padding: 7px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.pagination .cur { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pagination .dots { border: 0; background: none; color: var(--muted); }

.tabs { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border: 1px solid var(--border); border-radius: 20px; color: var(--muted); font-size: 14px; }
.tabs a.active, .tabs a:hover { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; margin-top: 16px; }
.watch-main { min-width: 0; }
.player-box { background: #000; border-radius: 8px; overflow: hidden; }
.player-box video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; }
.embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.watch-title { font-size: 20px; margin: 14px 0 6px; }
.watch-meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.actions { display: flex; gap: 10px; margin-bottom: 14px; }
.vote {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.vote:hover { border-color: var(--accent); }
.tagrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.tagrow a { background: var(--panel); border: 1px solid var(--border); padding: 4px 10px; border-radius: 16px; font-size: 13px; color: var(--muted); }
.tagrow a:hover { color: var(--text); border-color: #3d3d3d; }
.description {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  white-space: pre-wrap;
  font-size: 14px;
  color: #cfcfcf;
  margin: 12px 0;
}
.description.static { overflow-wrap: break-word; }

.comments { margin-top: 18px; }
.comment { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.comment .who { font-weight: 700; font-size: 13px; }
.comment .when { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.comment p { margin: 6px 0 0; font-size: 14px; }
.comment-form input, .comment-form textarea {
  width: 100%;
  background: #0d0d0d;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  font: inherit;
}
.comment-form textarea { min-height: 80px; resize: vertical; }
.btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 9px 18px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
}

.watch-side { min-width: 0; }
.related-card { display: flex; gap: 10px; margin-bottom: 10px; }
.rthumb { position: relative; width: 150px; height: 84px; flex: none; background: #000; border-radius: 6px; overflow: hidden; }
.rthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rinfo { min-width: 0; }
.rtitle { font-size: 13px; font-weight: 600; line-height: 1.3; display: block; }
.rtitle:hover { color: var(--accent); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cat-tile {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: block;
}
.cat-tile:hover { border-color: #3d3d3d; }
.cat-tile img { border-radius: 6px; margin-bottom: 8px; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.cat-name { display: block; font-weight: 700; }
.cat-count { color: var(--muted); font-size: 12px; }

.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagpill { background: var(--panel); border: 1px solid var(--border); padding: 6px 12px; border-radius: 16px; font-size: 14px; color: var(--muted); }
.tagpill span { color: var(--accent); font-weight: 600; }
.tagpill:hover { color: var(--text); border-color: #3d3d3d; }

.empty { color: var(--muted); padding: 14px 0; }
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
.site-footer p { margin: 0 0 10px; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--text); }

@media (max-width: 960px) {
  .watch { grid-template-columns: 1fr; }
  .topbar-in { flex-wrap: wrap; height: auto; padding: 10px 0; }
  .search { order: 3; flex-basis: 100%; }
}
