:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface2: #f0f5fc;
  --border: #d4e2f4;
  --text: #1a2b4a;
  --muted: #5a6f8f;
  --accent: #276fdb;
  --accent-dark: #1e5bb8;
  --accent-light: #e8f1fd;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(39, 111, 219, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: min(1400px, 100% - 2rem);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 12px rgba(39, 111, 219, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  margin-right: auto;
  flex-shrink: 0;
}

.logo img {
  height: 42px;
  width: auto;
}

.nav-main {
  display: flex;
  gap: .25rem;
}

.nav-main a {
  padding: .45rem .85rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
}

.nav-main a:hover,
.nav-main a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.search-form {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.search-form input {
  width: 100%;
  padding: .55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text);
  font-size: .9rem;
}

.search-form input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
  background: #fff;
}

.lang-switch select {
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: .85rem;
}

.site-main { padding: 1.5rem 0 3rem; }

.page-head h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 1rem;
  font-weight: 700;
  color: var(--text);
}

.lead { color: var(--muted); margin: 0 0 1.5rem; }

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.pill {
  padding: .4rem .9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .85rem;
  transition: border-color .2s, background .2s, transform .2s;
}

.pill span { color: var(--muted); margin-left: .25rem; }
.pill:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
}
.pill-muted { color: var(--muted); }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: #e8f1fd;
  overflow: hidden;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(26, 43, 74, 0.85);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
}

.video-title {
  font-size: .92rem;
  font-weight: 600;
  margin: .65rem .75rem .25rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.video-meta {
  margin: 0 .75rem .75rem;
  font-size: .8rem;
  color: var(--muted);
}

.player-wrap {
  background: #0d1b33;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}

.player-wrap video,
.player-wrap .player-embed {
  width: 100%;
  max-height: 72vh;
  display: block;
  background: #000;
}

.player-wrap .player-embed {
  aspect-ratio: 16 / 9;
  min-height: 360px;
  border: 0;
}

.video-header h1 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  margin: 0 0 .5rem;
  color: var(--text);
}

.video-stats {
  display: flex;
  gap: 1rem;
  color: var(--muted);
  font-size: .9rem;
  margin: 0 0 1rem;
}

.video-desc {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
  max-width: 80ch;
}

.related-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-section h2 {
  font-size: 1.2rem;
  margin: 0 0 1rem;
  color: var(--text);
}

.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
}

.category-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, background .2s;
}

.category-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.category-thumb,
.category-avatar {
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 8px;
  background: var(--border);
}

.category-thumb { width: 80px; height: 80px; }
.category-avatar { width: 120px; height: 120px; }

.category-body {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 0;
}

.category-name { font-weight: 600; }
.category-desc {
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.category-count { color: var(--muted); font-size: .85rem; }

.legal-body {
  max-width: 720px;
  line-height: 1.6;
  color: var(--text);
}

.legal-body p { margin: 0 0 1rem; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.page-btn {
  padding: .5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
}

.page-btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.page-info { color: var(--muted); font-size: .9rem; }

.empty { color: var(--muted); text-align: center; padding: 3rem; }

.error-page {
  text-align: center;
  padding: 4rem 1rem;
}

.error-page h1 {
  font-size: 4rem;
  margin: 0;
  color: var(--accent);
}

.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: .65rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
}

.btn:hover { background: var(--accent-dark); }

.taxonomy-nav {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin: 0 0 1rem;
}

.taxonomy-group {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

.taxonomy-label {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  margin-right: .25rem;
}

.taxonomy-link {
  padding: .25rem .65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--accent-dark);
}

.taxonomy-link:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.model-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .2s, transform .2s, background .2s;
}

.model-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.model-card img,
.model-placeholder {
  width: 100px;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: .5rem;
  background: var(--surface2);
}

.model-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.model-name { font-weight: 600; font-size: .9rem; }
.model-count { color: var(--muted); font-size: .78rem; margin-top: .2rem; }

.model-avatar {
  float: left;
  margin: 0 1rem .5rem 0;
  border-radius: 8px;
  object-fit: cover;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.page-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.seo-intro {
  max-width: 72ch;
  line-height: 1.65;
}

.breadcrumbs {
  margin-bottom: 1rem;
  font-size: .85rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
}

.breadcrumbs li:not(:last-child)::after {
  content: '›';
  margin-left: .35rem;
  color: var(--border);
}

.breadcrumbs a {
  color: var(--accent);
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.seo-footer-blurb {
  max-width: 60ch;
  margin: 0 auto 1rem;
  line-height: 1.6;
  color: var(--muted);
  font-size: .82rem;
}

.seo-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem 1.25rem;
  margin-bottom: 1rem;
}

.seo-footer-links a {
  color: var(--accent-dark);
  font-size: .85rem;
  font-weight: 500;
}

.seo-footer-links a:hover {
  color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface2);
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}

.site-footer .copyright {
  margin: 0;
  font-size: .78rem;
}

@media (max-width: 768px) {
  .header-inner { gap: .75rem; }
  .nav-main { order: 3; width: 100%; }
  .search-form { max-width: none; flex: 1 1 100%; order: 2; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
  .logo img { height: 34px; }
}