:root {
  --bg: #0b0d12;
  --bg-elevated: #141821;
  --bg-card: #161b26;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f5f9;
  --muted: #9aa3b5;
  --accent: #ff2d55;
  --accent-soft: rgba(255, 45, 85, 0.16);
  --gold: #f5c518;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% -10%, rgba(255, 45, 85, 0.22), transparent 60%),
    radial-gradient(ellipse 50% 35% at 90% 0%, rgba(88, 101, 242, 0.16), transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(245, 197, 24, 0.06), transparent 50%);
  z-index: 0;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}

.site-header, .main, .site-footer { position: relative; z-index: 1; }

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  background: rgba(11, 13, 18, 0.72);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #ff7a59 55%, var(--gold));
  box-shadow: 0 0 24px rgba(255, 45, 85, 0.35);
}

.brand-text { font-size: 1.1rem; }
.tagline { margin: 0; color: var(--muted); font-size: 0.9rem; }

.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  margin-bottom: 1.75rem;
}
.hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}
.count {
  color: var(--muted);
  font-size: 0.92rem;
}
.search-wrap { flex: 1; min-width: 180px; max-width: 320px; }
.search-wrap input {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap input:focus {
  border-color: rgba(255, 45, 85, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-wrap input::placeholder { color: #6b7385; }

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  text-align: left;
  color: inherit;
  padding: 0;
  font: inherit;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 45, 85, 0.35);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55);
  outline: none;
}

.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #0f131b;
  overflow: hidden;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.card:hover .cover img { transform: scale(1.04); }

.play-badge {
  position: absolute;
  inset: auto auto 12px 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  color: white;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.play-badge svg { width: 16px; height: 16px; margin-left: 2px; }

.sample-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1a1200;
  background: var(--gold);
}

.card-body {
  padding: 0.95rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}
.card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.82rem;
}
.author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.views {
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}
.hidden { display: none !important; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  width: min(420px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1rem 1rem 1.15rem;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
}
.modal-meta {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }

.embed-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 65vh;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.embed-wrap iframe,
.embed-wrap video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: contain;
  background: #000;
}
.btn.secondary {
  opacity: 0.55;
  font-size: 0.8rem;
  font-weight: 400;
}
.btn.secondary:hover { opacity: 0.85; }
.modal-actions:has(.hidden) { display: none; }
.embed-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
}

.modal-actions {
  margin-top: 0.9rem;
  display: flex;
  justify-content: flex-end;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
}
.btn.ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: transparent;
}
.btn.ghost:hover { border-color: rgba(255, 255, 255, 0.22); }

@media (max-width: 560px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .toolbar { align-items: stretch; }
  .search-wrap { max-width: none; }
  .modal-panel { width: 100%; border-radius: 18px; }
}
