:root {
  --pink: #ff8fb8;
  --pink-soft: #ffb6d1;
  --purple: #a78bfa;
  --gold: #ffd27d;
  --bg: #0a0618;
  --card: rgba(30, 20, 50, 0.6);
  --border: rgba(255, 170, 210, 0.2);
  --text: #f5eef8;
  --text-dim: rgba(245, 238, 248, 0.62);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 700px at 12% 8%, rgba(167, 139, 250, 0.16), transparent 60%),
    radial-gradient(1000px 700px at 88% 12%, rgba(255, 143, 184, 0.14), transparent 60%),
    radial-gradient(900px 800px at 50% 100%, rgba(143, 199, 255, 0.12), transparent 60%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  background: linear-gradient(180deg, rgba(10, 6, 24, 0.9), rgba(10, 6, 24, 0.45));
  backdrop-filter: blur(10px);
}

.back {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: 0.2s;
}

.back:hover {
  color: var(--pink-soft);
}

.title-wrap {
  flex: 1;
  text-align: center;
}

.title {
  font-size: 24px;
  letter-spacing: 3px;
  background: linear-gradient(90deg, var(--pink-soft), var(--purple), var(--pink-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.topbar-spacer {
  width: 88px;
  flex-shrink: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: fadeUp 0.6s ease both;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 143, 184, 0.55);
  box-shadow: 0 16px 40px rgba(255, 143, 184, 0.18);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.25), rgba(255, 143, 184, 0.25));
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .card-img {
  transform: scale(1.06);
}

.card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  background: rgba(10, 6, 24, 0);
  transition: background 0.3s ease;
}

.card-play::before {
  content: "▶";
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 143, 184, 0.85);
  box-shadow: 0 6px 20px rgba(255, 143, 184, 0.5);
  transform: scale(0.8);
  opacity: 0;
  transition: 0.3s ease;
}

.card:hover .card-play {
  background: rgba(10, 6, 24, 0.25);
}

.card:hover .card-play::before {
  transform: scale(1);
  opacity: 1;
}

.card-cover.no-cover::after {
  content: "视频祝福";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  letter-spacing: 2px;
  color: rgba(245, 238, 248, 0.5);
}

.card-info {
  padding: 14px 16px 16px;
}

.card-title {
  font-size: 15px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-author {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.loading,
.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 80px 0;
  font-size: 14px;
  letter-spacing: 2px;
}

.loading-star {
  display: block;
  margin-bottom: 14px;
  font-size: 40px;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold);
  animation: twinkle 1.2s ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 3, 14, 0.82);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(900px, 96vw);
  background: rgba(24, 16, 42, 0.9);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  animation: pop 0.28s ease;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #1c1130;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: 0.2s;
}

.modal-close:hover {
  background: var(--pink);
  color: #fff;
}

.video-frame-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-info {
  padding: 14px 8px 4px;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
}

.modal-author {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .topbar {
    padding: 14px 16px;
    gap: 12px;
  }

  .back {
    font-size: 13px;
  }

  .title {
    font-size: 18px;
    letter-spacing: 2px;
  }

  .subtitle {
    font-size: 11px;
  }

  .topbar-spacer {
    width: 0;
  }

  .container {
    padding: 20px 14px 70px;
  }

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

  .card-info {
    padding: 10px 12px 12px;
  }

  .card-title {
    font-size: 13px;
  }

  .modal {
    padding: 12px;
  }

  .modal-close {
    top: -10px;
    right: -10px;
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}
