/* ============================================================
   像素 C++ · 16 集
   CRT 街机 / 荧光绿 + 琥珀色
   ============================================================ */
:root {
  --bg: #060907;
  --bg-2: #0a110d;
  --panel: #0c1511;
  --panel-2: #101b16;
  --line: #1d2e26;
  --line-strong: #2f4a3c;
  --ink: #dcebe1;
  --ink-2: #a9c2b3;
  --dim: #728a7c;
  --green: #7dffb0;
  --green-rgb: 125, 255, 176;
  --amber: #ffc857;
  --amber-rgb: 255, 200, 87;
  --red: #ff6b6b;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", system-ui, sans-serif;
  --pixel: "Fusion Pixel 12px Proportional Simplified Chinese", "Microsoft YaHei", monospace;
  --shadow: 7px 7px 0 rgba(0, 0, 0, .75);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--bg);
  scrollbar-color: #2b4438 #070c09;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(var(--green-rgb), .10), transparent 62%),
    radial-gradient(760px 480px at 100% 0%, rgba(var(--amber-rgb), .07), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 60%, var(--bg) 100%);
}

/* 背景网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(var(--green-rgb), .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--green-rgb), .045) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}

/* CRT 扫描线 */
.crt {
  position: fixed;
  inset: 0;
  z-index: 981;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, .028) 0,
    rgba(255, 255, 255, .028) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: .65;
}

::selection { background: rgba(var(--green-rgb), .3); color: #04120b; }

.site-head,
.wrap,
.site-foot {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---------------- 顶部 ---------------- */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 38px 0 26px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  font-family: var(--pixel);
  font-size: 24px;
  letter-spacing: 1px;
  color: #06130c;
  background: var(--green);
  border: 3px solid #000;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .8);
  text-shadow: none;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--pixel);
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: 2px;
  color: #eaffef;
  text-shadow:
    3px 3px 0 rgba(0, 0, 0, .85),
    0 0 26px rgba(var(--green-rgb), .25);
}

.brand-text p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--dim);
  letter-spacing: .5px;
}

.head-stats {
  display: flex;
  gap: 10px;
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--ink-2);
}

.head-stats span {
  padding: 8px 12px;
  border: 2px solid var(--line-strong);
  background: rgba(12, 21, 17, .8);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .7);
}

.head-stats b {
  color: var(--amber);
  font-weight: normal;
  font-size: 16px;
  margin-right: 2px;
}

/* ---------------- 合集标题 ---------------- */
.collection + .collection { margin-top: 48px; }

.col-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 22px;
}

.col-tag {
  flex-shrink: 0;
  font-family: var(--pixel);
  font-size: 14px;
  line-height: 1;
  padding: 9px 10px 8px;
  color: #10130a;
  background: var(--green);
  border: 3px solid #000;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .8);
}

.collection[data-col="ai"] .col-tag { background: var(--amber); }

.col-title { min-width: 0; }

.col-title h2 {
  margin: 0;
  font-family: var(--pixel);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 1px;
  color: #eaffef;
}

.col-title p {
  margin: 6px 0 0;
  font-size: 13px;
  letter-spacing: .3px;
  color: var(--dim);
}

.col-count {
  flex-shrink: 0;
  margin-left: auto;
  font-family: var(--pixel);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 7px 10px 6px;
  color: var(--ink-2);
  border: 2px solid var(--line-strong);
  background: rgba(12, 21, 17, .8);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .7);
}

/* ---------------- 海报墙 ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 26px 22px;
  padding-bottom: 44px;
}

.card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  color: inherit;
  background: var(--panel);
  border: 3px solid #000;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.card:hover,
.card:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, .8);
  border-color: var(--green);
  outline: none;
}

.card:active { transform: translate(0, 0); box-shadow: 4px 4px 0 rgba(0, 0, 0, .8); }

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #040806;
  border-bottom: 3px solid #000;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
  filter: saturate(1.02) contrast(1.03);
  transition: transform .25s ease;
}

.card:hover .thumb img { transform: scale(1.035); }

.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .16) 0, rgba(0, 0, 0, .16) 1px, transparent 1px, transparent 3px),
    linear-gradient(180deg, rgba(3, 8, 6, .30) 0%, transparent 28%, transparent 62%, rgba(3, 8, 6, .82) 100%);
}

.card-no {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-family: var(--pixel);
  font-size: 12px;
  line-height: 1;
  padding: 5px 7px 4px;
  color: #10130a;
  background: var(--amber);
  border: 2px solid #000;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .8);
}

.card-play {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background: rgba(6, 15, 10, .72);
  border: 3px solid var(--green);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .55), 0 0 26px rgba(var(--green-rgb), .35);
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease;
}

.card-play::before {
  content: "";
  margin-left: 4px;
  border-left: 15px solid var(--green);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.card:hover .card-play,
.card:focus-visible .card-play { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }

.card-body {
  display: block;
  padding: 12px 13px 14px;
}

.card-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: #ecf7f0;
  letter-spacing: .2px;
  min-height: 45px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
  font-family: var(--pixel);
  font-size: 12px;
  letter-spacing: .5px;
  color: var(--dim);
}

.card-meta .dur { color: var(--green); }

.site-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 0 34px;
  border-top: 2px solid var(--line);
  font-family: var(--pixel);
  font-size: 12px;
  letter-spacing: 1px;
  color: #5d7567;
}

.foot-dot { color: var(--green); }

/* ---------------- 播放弹层 ---------------- */
.player {
  position: fixed;
  inset: 0;
  z-index: 990;
  display: grid;
  place-items: center;
  padding: 24px;
}

.player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 4, .86);
  backdrop-filter: blur(3px);
  animation: fade .16s ease both;
}

.player-card {
  position: relative;
  width: min(1080px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 3px solid var(--line-strong);
  box-shadow: 12px 12px 0 rgba(0, 0, 0, .8), 0 0 60px rgba(var(--green-rgb), .08);
  animation: pop .18s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 2px solid #000;
  background: var(--panel-2);
}

.player-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.player-no {
  flex-shrink: 0;
  font-family: var(--pixel);
  font-size: 12px;
  padding: 5px 7px 4px;
  color: #10130a;
  background: var(--amber);
  border: 2px solid #000;
}

.player-meta h2 {
  margin: 0;
  font-family: var(--pixel);
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 1px;
  color: #eaffef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-dur {
  flex-shrink: 0;
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--dim);
}

.player-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-family: var(--pixel);
  font-size: 16px;
  color: var(--ink-2);
  background: #0a120e;
  border: 2px solid var(--line-strong);
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease;
}

.player-close:hover { color: var(--red); border-color: var(--red); }

.player-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.player-stage video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-top: 2px solid #000;
  background: var(--panel-2);
}

.nav-btn {
  font-family: var(--pixel);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 9px 14px;
  color: var(--ink-2);
  background: #0a120e;
  border: 2px solid var(--line-strong);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .8);
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, transform .12s ease;
}

.nav-btn:hover:not(:disabled) {
  color: var(--green);
  border-color: var(--green);
  transform: translate(-1px, -1px);
}

.nav-btn:active:not(:disabled) { transform: none; box-shadow: 1px 1px 0 rgba(0, 0, 0, .8); }

.nav-btn:disabled { opacity: .35; cursor: default; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .site-head { padding-top: 28px; }
  .brand-text h1 { font-size: 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px 18px; }
  .player-meta h2 { font-size: 16px; }
}

@media (max-width: 640px) {
  .site-head,
  .wrap,
  .site-foot { width: calc(100% - 28px); }
  .site-head { flex-wrap: wrap; gap: 14px; }
  .brand-mark { width: 48px; height: 48px; font-size: 20px; }
  .brand-text h1 { font-size: 24px; letter-spacing: 1px; }
  .brand-text p { font-size: 12px; }
  .head-stats { font-size: 12px; }
  .head-stats span { padding: 6px 9px; }
  .col-head { flex-wrap: wrap; gap: 10px; }
  .col-tag { font-size: 12px; padding: 7px 8px 6px; }
  .col-title h2 { font-size: 18px; }
  .col-title p { font-size: 12px; }
  .col-count { margin-left: 0; }
  .grid { grid-template-columns: 1fr; gap: 20px; }
  .card-title { min-height: 0; }

  .player { padding: 12px; }
  .player-card { max-height: calc(100vh - 24px); }
  .player-meta { gap: 8px; }
  .player-meta h2 { font-size: 14px; letter-spacing: 0; }
  .player-dur { display: none; }
  .player-foot { padding: 10px; }
  .nav-btn { padding: 8px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .thumb img, .card-play { transition: none; }
  .player-card, .player-backdrop { animation: none; }
}
