/* =========================================
   기본 변수 및 초기화 (화이트 & 블루 테마)
   ========================================= */
:root {
  --bg: #f9f9f9;          /* 전체 배경 (연한 회색) */
  --card: #ffffff;        /* 카드 배경 (흰색) */
  --accent: #1a6dff;      /* 파란색 포인트 */
  --accent-dark: #0f52c4; /* 진한 파란색 */
  --text: #333333;        /* 기본 텍스트 */
  --muted: #888888;       /* 회색 텍스트 */
  --border: #eaeaea;      /* 연한 테두리 */
  --header-bg: #2979ff;   /* 상단 헤더 파란색 */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Malgun Gothic", sans-serif;
}

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

/* =========================================
   헤더 (파란색 배경이 화면 끝까지 꽉 차도록 수정)
   ========================================= */
.hd {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.hd-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 32px;
  max-width: 1400px;
  margin: 0 auto;
  height: 64px;
}

.logo {
  font-weight: 900;
  color: #fff;
  font-size: 24px;
  white-space: nowrap;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
}

/* 한줄공지 (파란 헤더에 어울리게 수정) */
.header-notice {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  max-width: 500px;
  height: 34px;
  overflow: hidden;
  margin: 0 auto;
}

.header-notice .notice-icon { font-size: 14px; flex-shrink: 0; }
.notice-scroll { flex: 1; overflow: hidden; white-space: nowrap; display: flex; }
.notice-scroll span { display: inline-block; padding-left: 100%; animation: marquee 15s linear infinite; }
.header-notice:hover .notice-scroll span { animation-play-state: paused; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* 검색창 (흰색 바탕) */
.search {
  display: flex;
  width: 300px;
  height: 34px;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.search input {
  flex: 1;
  border: none;
  color: var(--text);
  padding: 0 12px;
  font-size: 13px;
  outline: none;
}

.search button {
  background: transparent;
  color: var(--header-bg);
  border: none;
  padding: 0 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
}

/* =========================================
   카테고리 탭 배경 (양옆 끝까지 흰색으로 이어지도록 수정)
   ========================================= */
.cat-tabs-wrapper {
  background: #fff;
  width: 100%;
  border-bottom: 1px solid var(--border);
}

.cat-tabs {
  display: flex;
  gap: 4px;
  padding: 0 32px;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: auto;
}

.cat-tabs a {
  color: var(--text);
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.cat-tabs a:hover { color: var(--accent); }
.cat-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

/* =========================================
   배너 영역 (PC 3개, 모바일 1개 격자 배치)
   ========================================= */
.banners {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr); /* PC에서 한 줄에 3개 */
  padding: 20px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.banner {
  border-radius: 8px;
  overflow: hidden;
  display: block;
  width: 100%;
  transition: transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.banner:hover {
  transform: translateY(-3px);
}

.banner img {
  display: block;
  width: 100%;
  height: 90px; /* 배너 높이 */
  object-fit: cover; /* 비율 유지 */
  border-radius: 8px;
}

/* =========================================
   메인 콘텐츠 영역
   ========================================= */
main {
  padding: 30px 32px 60px;
  max-width: 1400px;
  margin: 0 auto;
}

.page-title { font-size: 24px; font-weight: bold; margin: 0 0 20px; color: #111; }
.page-title .cnt { color: var(--muted); font-size: 16px; font-weight: normal; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* =========================================
   섹션 헤더
   ========================================= */
.sec, .hero { margin-bottom: 50px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.sec-head h1, .sec-head h2 { font-size: 22px; font-weight: 800; margin: 0; color: #111; }
.sec-head .more { color: var(--muted); font-size: 14px; }
.sec-head .more:hover { color: var(--accent); }

/* =========================================
   [핵심] 그리드 및 카드 디자인 (화이트 테마)
   ========================================= */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(6, 1fr);
  align-items: start;
}

.card {
  background: transparent;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-5px);
}

/* 카드 이미지 */
.card-img-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

/* 이미지 위 회차 오버레이 */
.card-ep-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
  text-align: center;
  padding: 20px 10px 10px;
  font-size: 14px;
  font-weight: 500;
}

/* 카드 텍스트 영역 */
.card .info {
  padding: 10px 0;
  display: flex;
  flex-direction: column;
}

.card .t {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
  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: var(--muted);
  text-align: center;
}

/* NEW 배지 */
.badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
  z-index: 10;
}

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

.play-head { display: flex; gap: 24px; margin-bottom: 24px; align-items: flex-start; background: #fff; padding: 24px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.play-head img { width: 160px; border-radius: 8px; flex-shrink: 0; }
.play-head h1 { margin: 0 0 12px; font-size: 24px; color: #111; }
.play-head .meta { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.play-head .cast { font-size: 14px; color: #555; margin-bottom: 12px; }
.play-head .cast a { color: var(--accent); }
.play-head .synopsis { font-size: 14px; color: #444; line-height: 1.6; margin-bottom: 12px; }

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

/* =========================================
   필터 바 및 페이지네이션
   ========================================= */
.filter-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  background: #fff;
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.filter-group { display: flex; gap: 10px; align-items: center; }
.filter-label { font-size: 14px; color: #111; font-weight: bold; }

.filter-bar select, .filter-bar input[type=search] {
  background: #f5f5f5;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
}

.filter-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 9px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}
.filter-btn:hover { background: var(--accent-dark); }

.pager { display: flex; gap: 5px; justify-content: center; margin-top: 40px; }
.pager a, .pager .cur {
  padding: 8px 14px;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 14px;
  border: 1px solid var(--border);
}
.pager a:hover { background: #f0f0f0; }
.pager .cur { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: bold; }

/* =========================================
   푸터
   ========================================= */
footer {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
footer a { color: #555; text-decoration: underline; }

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

@media (max-width: 900px) {
  .hd-top { 
    padding: 10px 16px; 
    height: auto; 
    flex-wrap: wrap; 
    justify-content: flex-start;
    gap: 8px 10px;
  }
  /* 로고는 왼쪽 고정 */
  .logo { 
    width: auto; 
    flex: 0 0 auto;
    justify-content: flex-start; 
    margin-bottom: 0; 
    font-size: 20px; 
  }
  .logo img { max-height: 26px; }

  /* 한줄공지: 로고 오른쪽에 나란히 */
  .header-notice {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    height: 28px;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 999px;
  }
  .header-notice .notice-icon { font-size: 12px; }

  .search { 
    order: 3;
    flex: 1 1 100%;
    width: 100%; 
    max-width: 100%; 
    margin-top: 8px;
  }
  
  .cat-tabs-wrapper { overflow-x: auto; }
  .cat-tabs { padding: 0 16px; }
  
  /* ★ 모바일 배너: 한 줄에 1개씩 */
  .banners {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }
  .banner img {
    height: 80px;
  }

  main { padding: 20px 16px; }
  .play-head { flex-direction: column; padding: 16px; }
  .play-head img { width: 140px; margin: 0 auto; }
}

@media (max-width: 768px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .card img { height: 220px; }
  .card .t { font-size: 14px; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card img { height: 180px; }
}