/* =========================================
   다크 테마 + 좌측 고정 카테고리 / 상단 고정 검색
   ========================================= */
:root {
  --side-w: 264px;          /* 좌측 카테고리 폭 */
  --hd-h: 64px;             /* 상단 고정 바 높이 */
  --bg: #1b1b1c;            /* 전체 배경 */
  --panel: #181819;         /* 사이드바 배경 */
  --card: #232326;          /* 카드/박스 배경 */
  --field: #2b2b2f;         /* 입력창 배경 */
  --accent: #2fd8c4;        /* 포인트 (민트) */
  --accent-dark: #1fb9a7;
  --text: #dcdcdc;          /* 본문 텍스트 */
  --text-strong: #f3f3f3;   /* 제목 텍스트 */
  --muted: #8b8b8f;         /* 보조 텍스트 */
  --line: #2a2a2d;          /* 구분선 */
  --notice-bg: #8b1418;     /* 상단 공지 띠 */
  --notice-text: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding-top: var(--hd-h);
  padding-left: var(--side-w);
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* =========================================
   상단 고정 바 (로고 + 검색창)
   ========================================= */
.hd {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hd-h);
  background: var(--bg);
  z-index: 120;
}

.hd-top {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 24px 0 18px;
  gap: 12px;
}

.hd-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  width: calc(var(--side-w) - 34px);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d8d8d8;
  cursor: pointer;
}
.nav-toggle:hover { background: #232326; color: #fff; }

.logo {
  font-weight: 900;
  color: var(--accent);
  font-size: 23px;
  letter-spacing: -1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.logo img { height: 30px; }

/* 검색창: 상단에 고정 */
.hd-mid {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 0 16px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(560px, 100%);
  height: 40px;
  background: var(--field);
  border-radius: 8px;
  padding: 0 8px 0 16px;
  transition: background .18s, box-shadow .18s;
}
.search:focus-within { background: #313136; box-shadow: 0 0 0 1px var(--accent) inset; }

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #e6e6e6;
  font-size: 15px;
  font-family: inherit;
}
.search input::placeholder { color: #82828a; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b9b9bd;
  cursor: pointer;
}
.search button:hover { color: #fff; }

.hd-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.hd-right a { color: #c4c4c8; font-size: 15px; white-space: nowrap; }
.hd-right a:hover { color: var(--accent); }

/* =========================================
   좌측 고정 카테고리
   ========================================= */
.side-cats {
  position: fixed;
  left: 0;
  top: var(--hd-h);
  bottom: 0;
  width: var(--side-w);
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 0 32px;
  z-index: 110;
}
.side-cats::-webkit-scrollbar { width: 6px; }
.side-cats::-webkit-scrollbar-thumb { background: #333338; border-radius: 3px; }

.side-nav { display: flex; flex-direction: column; }

.side-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
  padding: 0 24px;
  color: #b4b4b9;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .16s, color .16s;
}
.side-nav a svg { width: 22px; height: 22px; flex: 0 0 22px; opacity: .85; }
.side-nav a:hover { background: #212124; color: #fff; }
.side-nav a:hover svg { opacity: 1; }
.side-nav a.active { color: var(--accent); background: #202023; }
.side-nav a.active svg { opacity: 1; }

.side-sep { height: 1px; background: var(--line); margin: 10px 18px; }

.side-mask {
  display: none;
  position: fixed;
  inset: var(--hd-h) 0 0 0;
  background: rgba(0, 0, 0, .55);
  z-index: 105;
}

/* =========================================
   상단 공지 띠
   ========================================= */
.notice-bar {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 24px;
  background: var(--notice-bg);
  color: var(--notice-text);
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
}
.notice-bar span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================
   배너 (오른쪽에서 롤링 인)
   ========================================= */
.banners {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);  /* 우측 창구 폭에 맞춰 3등분 */
  align-items: start;
  padding: 18px 24px 0;
  max-width: 1500px;
  margin: 0 auto;
}

.banner {
  display: block;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #26262a;
  width: 100%;
  height: auto;
  aspect-ratio: 489 / 120;   /* 프레임도 같은 비율로 자동 축소/확대 */
  transition: transform .2s;
}
.banner:hover { transform: translateY(-2px); }
.banner img {
  position: absolute;        /* 프레임 안에서만 표시 */
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;       /* 원본 비율 그대로 프레임 안에 맞춤 */
  object-position: center;
  border-radius: 6px;
  background: #26262a;
}

/* =========================================
   메인 콘텐츠
   ========================================= */
main {
  padding: 30px 24px 60px;
  max-width: 1500px;
  margin: 0 auto;
}

.page-title { font-size: 24px; font-weight: 800; margin: 0 0 20px; color: var(--text-strong); }
.page-title .cnt { color: var(--muted); font-size: 15px; font-weight: 400; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

.sec, .hero { margin-bottom: 48px; }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.sec-head h1, .sec-head h2 { font-size: 21px; font-weight: 800; margin: 0; color: var(--text-strong); }
.sec-head .more { color: var(--muted); font-size: 14px; white-space: nowrap; }
.sec-head .more:hover { color: var(--accent); }

/* 그리드 / 카드 */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  align-items: start;
}

.card { display: flex; flex-direction: column; position: relative; transition: transform .2s; }
.card:hover { transform: translateY(-4px); }

.card-img-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #26262a;
}
.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  background: #26262a;
}
.card-img-wrap img { border-radius: 0; }

.card-ep-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0, 0, 0, .85));
  color: #fff;
  text-align: center;
  padding: 22px 10px 10px;
  font-size: 13px;
  font-weight: 500;
}

.card .info { padding: 9px 2px 0; display: flex; flex-direction: column; }
.card .t {
  font-size: 15px;
  font-weight: 600;
  color: #e8e8ea;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center;
}
.card .t:hover { color: var(--accent); }
.card .y { font-size: 12px; color: #7c7c82; text-align: center; }

.badge-new {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #10201d;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
  z-index: 10;
}

/* vcard (공용 카드 헬퍼 사용 시) */
.vcard { display: block; }
.vcover { position: relative; border-radius: 8px; overflow: hidden; background: #26262a; }
.vcover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; }
.vdate, .vep {
  position: absolute; bottom: 8px; font-size: 11px; color: #fff;
  background: rgba(0, 0, 0, .6); border-radius: 4px; padding: 2px 6px;
}
.vdate { left: 8px; }
.vep { right: 8px; }
.vinfo { padding: 9px 2px 0; }
.vtitle { font-size: 15px; font-weight: 600; color: #e8e8ea; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vsub { font-size: 12px; color: #7c7c82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================
   필터 바 / 페이지네이션
   ========================================= */
.filter-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--card);
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.filter-group { display: flex; gap: 8px; align-items: center; }
.filter-label { font-size: 14px; color: #c9c9cd; font-weight: 600; }

.filter-bar select, .filter-bar input[type=search] {
  background: var(--field);
  border: 1px solid #3a3a3f;
  color: #e6e6e6;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.filter-bar select:focus, .filter-bar input[type=search]:focus { border-color: var(--accent); }

.filter-btn {
  background: var(--accent);
  color: #10201d;
  border: 0;
  padding: 9px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
}
.filter-btn:hover { background: var(--accent-dark); }
.filter-reset { color: var(--muted); font-size: 14px; }
.filter-reset:hover { color: var(--accent); }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.pager a, .pager .cur {
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--card);
  color: #cfcfd3;
  font-size: 14px;
  border: 1px solid var(--line);
}
.pager a:hover { background: #2c2c31; color: #fff; }
.pager .cur { background: var(--accent); color: #10201d; border-color: var(--accent); font-weight: 800; }

/* =========================================
   상세 / 재생 페이지
   ========================================= */
.play-page, .preview-page { padding: 24px 24px 60px; max-width: 1200px; margin: 0 auto; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: #a9a9ae; }
.breadcrumb a:hover { color: var(--accent); }

.play-head {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  align-items: flex-start;
  background: var(--card);
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.play-head img { width: 160px; border-radius: 8px; flex-shrink: 0; }
.play-head h1 { margin: 0 0 12px; font-size: 23px; color: var(--text-strong); }
.play-head .meta { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.play-head .cast, .play-head .cast-line { font-size: 14px; color: #b3b3b8; margin-bottom: 12px; }
.play-head .cast a { color: var(--accent); }
.play-head .synopsis { font-size: 14px; color: #b3b3b8; line-height: 1.65; margin-bottom: 12px; }

.preview-head { margin-bottom: 16px; }
.preview-head h1 { font-size: 22px; color: var(--text-strong); margin: 0 0 8px; }
.preview-note { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45);
}
.player-wrap iframe, .player-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =========================================
   푸터
   ========================================= */
footer {
  padding: 36px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #171718;
  border-top: 1px solid var(--line);
  margin-top: 60px;
}
footer p { margin: 6px 0; }
footer a { color: #a9a9ae; text-decoration: underline; }
footer .small { font-size: 12px; color: #6d6d73; }

/* =========================================
   오른쪽에서 롤링 인 (배너 / 콘텐츠 박스)
   ========================================= */
@keyframes rollInRight {
  from { opacity: 0; transform: translateX(96px); }
  to   { opacity: 1; transform: translateX(0); }
}

.roll-in {
  animation: rollInRight .7s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: var(--roll-delay, 0s);
}

@media (prefers-reduced-motion: reduce) {
  .roll-in { animation: none; }
  .banner, .card, .search { transition: none; }
}

/* =========================================
   반응형
   ========================================= */
@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 1024px) {
  body { padding-left: 0; }
  body.side-open { overflow: hidden; }
  .hd-left { width: auto; }
  .nav-toggle { display: flex; }
  .hd-right { display: none; }

  .side-cats {
    width: 260px;
    transform: translateX(-100%);
    transition: transform .26s ease;
    box-shadow: 0 0 24px rgba(0, 0, 0, .5);
    z-index: 115;
  }
  body.side-open .side-cats { transform: translateX(0); }
  body.side-open .side-mask { display: block; }
}

@media (max-width: 900px) {
  .hd-top { padding: 0 14px; gap: 8px; }
  .logo { font-size: 20px; }
  .search { height: 36px; padding: 0 6px 0 12px; }
  .search input { font-size: 14px; }
  .notice-bar { height: 40px; padding: 0 14px; font-size: 13px; }
  .banners { padding: 14px 14px 0; grid-template-columns: 1fr; gap: 10px; }
  .banner { width: 100%; }
  main { padding: 20px 14px 48px; }
  .play-page, .preview-page { padding: 18px 14px 48px; }
  .play-head { flex-direction: column; padding: 16px; }
  .play-head img { width: 140px; margin: 0 auto; }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .card .t { font-size: 13px; }
  .banners { grid-template-columns: 1fr; }
  .sec-head h1, .sec-head h2 { font-size: 18px; }
}
