/* ─── Reset & Variables ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:   #07c160;
  --orange:  #ff9800;
  --red:     #fa5151;
  --blue:    #06c;
  --text:    #1a1a1a;
  --text-2:  #555;
  --text-3:  #888;
  --border:  #e8e8e8;
  --bg:      #f7f7f7;
  --white:   #fff;
  --radius:  8px;
  --shadow:  0 2px 8px rgba(0,0,0,.08);
  --max-w:   1200px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; object-fit: cover; }

/* ─── Header ────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: 4px;
}

.main-nav a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-2);
  transition: all .15s;
}

.main-nav a:hover, .main-nav a.active {
  background: #f0f5ff;
  color: var(--blue);
}

.search-form {
  display: flex;
  flex: 1;
  max-width: 400px;
  margin-left: auto;
}

.search-form input {
  flex: 1;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 6px 0 0 6px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}

.search-form input:focus { border-color: var(--blue); }

.search-form button {
  padding: 7px 16px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.search-form button:hover { background: #0055bb; }

/* ─── Main ──────────────────────────────────────────────── */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px;
}

/* ─── Hero ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0066cc 0%, #0044aa 100%);
  color: var(--white);
  text-align: center;
  padding: 52px 20px 44px;
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.hero h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.hero p  { font-size: 15px; opacity: .85; margin-bottom: 24px; }

.hero-search {
  display: flex;
  max-width: 560px;
  margin: 0 auto 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

.hero-search input {
  flex: 1;
  padding: 12px 18px;
  border: none;
  border-radius: 8px 0 0 8px;
  font-size: 15px;
  outline: none;
}

.hero-search button {
  padding: 12px 24px;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background .15s;
}

.hero-search button:hover { background: #e68900; }

.hero-tags { font-size: 13px; opacity: .8; }
.hero-tags a {
  display: inline-block;
  margin: 0 4px;
  padding: 3px 10px;
  background: rgba(255,255,255,.15);
  border-radius: 12px;
  transition: background .15s;
}
.hero-tags a:hover { background: rgba(255,255,255,.28); }

/* ─── Section ───────────────────────────────────────────── */
.section { margin-bottom: 32px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.more-link { font-size: 13px; color: var(--blue); }
.more-link:hover { text-decoration: underline; }

/* ─── VOD Grid ──────────────────────────────────────────── */
.vod-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) { .vod-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 900px)  { .vod-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 680px)  { .vod-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
@media (max-width: 420px)  { .vod-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }

/* ─── VOD Card ──────────────────────────────────────────── */
.vod-card {
  display: block;
  transition: transform .2s;
}

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

.card-poster {
  position: relative;
  aspect-ratio: 2/3;
  background: #e8e8e8;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}

.card-poster img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity .2s;
}

.card-poster img[src=""], .card-poster img:not([src]) { opacity: 0; }

/* aspect-ratio fallback for old browsers */
@supports not (aspect-ratio: 2/3) {
  .card-poster { height: 0; padding-bottom: 150%; }
  .card-poster img { position: absolute; top: 0; left: 0; }
}

.score {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,.6);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.no-score { color: #ccc !important; }

.remarks {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: var(--white);
  font-size: 11px;
  padding: 16px 6px 5px;
  text-align: center;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.card-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.vod-card:hover .card-title { color: var(--blue); }

/* ─── Detail Page ───────────────────────────────────────── */
.breadcrumb {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--blue); }
.breadcrumb a:hover { text-decoration: underline; }

.detail-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

@media (max-width: 640px) {
  .detail-wrap { grid-template-columns: 1fr; }
}

.detail-poster {
  position: relative;
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: var(--radius);
}

.poster-score {
  text-align: center;
  margin-top: 12px;
  font-weight: 700;
}

.poster-score .score-num { font-size: 36px; display: block; }
.poster-score .score-label { font-size: 12px; color: var(--text-3); }

.detail-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.detail-en {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 16px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.meta-item { display: flex; align-items: center; gap: 6px; }

.meta-label {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.meta-value { font-size: 14px; font-weight: 500; }
.meta-value.link { color: var(--blue); }
.meta-value.link:hover { text-decoration: underline; }
.meta-value.highlight { color: var(--orange); }

.detail-people {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.people-label {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  padding-top: 2px;
  min-width: 36px;
}

.people-list { display: flex; flex-wrap: wrap; gap: 6px; }

.person-tag {
  padding: 3px 10px;
  background: #f0f5ff;
  color: var(--blue);
  border-radius: 12px;
  font-size: 13px;
  transition: background .15s;
}

.person-tag:hover { background: #d0e4ff; }

.detail-desc { margin-top: 20px; }
.detail-desc h3 { font-size: 15px; margin-bottom: 10px; }

.desc-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.desc-toggle {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

.detail-review {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.detail-review h3 {
  font-size: 15px;
  margin-bottom: 12px;
}

.review-content {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-2);
}

/* ─── Filter Bar ────────────────────────────────────────── */
.filter-bar {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.filter-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-group:last-child { margin-bottom: 0; }

.filter-label {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  padding-top: 4px;
  min-width: 36px;
}

.filter-items { display: flex; flex-wrap: wrap; gap: 6px; }

.filter-item {
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all .15s;
}

.filter-item:hover { border-color: var(--blue); color: var(--blue); }
.filter-item.active { background: var(--blue); color: var(--white); }

/* ─── List Header ───────────────────────────────────────── */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.list-title { font-size: 20px; font-weight: 600; }
.list-count  { font-size: 13px; color: var(--text-3); }

/* ─── Pagination ────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.pg-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-2);
  background: var(--white);
  transition: all .15s;
}

.pg-btn:hover { border-color: var(--blue); color: var(--blue); }
.pg-btn.active { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* ─── Search Page ───────────────────────────────────────── */
.search-bar-large {
  display: flex;
  max-width: 600px;
  margin: 0 auto 24px;
}

.search-bar-large input {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 15px;
  outline: none;
}

.search-bar-large input:focus { border-color: var(--blue); }

.search-bar-large button {
  padding: 12px 24px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 0 8px 8px 0;
  font-size: 15px;
  cursor: pointer;
}

.search-result-header {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-2);
}

.search-hot { margin-top: 20px; }
.search-hot h3 { font-size: 16px; margin-bottom: 12px; }
.hot-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.hot-tag {
  padding: 6px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 14px;
  color: var(--text-2);
  transition: all .15s;
}

.hot-tag:hover { border-color: var(--blue); color: var(--blue); }

/* ─── Empty State ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 15px;
}

/* ─── Footer ────────────────────────────────────────────── */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  margin-top: 40px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.footer-links a { font-size: 13px; color: var(--text-2); }
.footer-links a:hover { color: var(--blue); }

.footer-note {
  font-size: 12px;
  color: var(--text-3);
  max-width: 600px;
  margin: 0 auto 6px;
}

.copyright { font-size: 12px; color: var(--text-3); }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner { gap: 12px; }
  .main-nav { display: none; }
  .search-form { max-width: 100%; }
  .main-content { padding: 12px; }
  .hero { padding: 32px 16px; }
  .hero h1 { font-size: 22px; }
  .detail-wrap { padding: 16px; gap: 16px; }
  .detail-title { font-size: 20px; }
}

/* ─── Sort Bar ──────────────────────────────────────────── */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.sort-item {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-2);
  transition: all .15s;
}
.sort-item:hover { color: var(--blue); }
.sort-item.active { background: var(--blue); color: var(--white); }

/* ─── Prev / Next Bar ───────────────────────────────────── */
.prev-next-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.prev-link, .next-link {
  font-size: 13px;
  color: var(--blue);
  max-width: 45%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prev-link:hover, .next-link:hover { text-decoration: underline; }

/* ─── Suggest List ──────────────────────────────────────── */
.suggest-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
  box-shadow: var(--shadow);
  list-style: none;
  z-index: 200;
  display: none;
  max-height: 240px;
  overflow-y: auto;
}
.suggest-list li {
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.suggest-list li:hover { background: #f0f5ff; }
.suggest-list li:last-child { border-bottom: none; }

.search-form { position: relative; }

/* ─── Mark highlight ────────────────────────────────────── */
mark {
  background: #fff3cd;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

/* ─── 404 / 500 ─────────────────────────────────────────── */
.not-found {
  text-align: center;
  padding: 80px 20px;
}
.not-found h1 {
  font-size: 80px;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
}
.not-found p {
  font-size: 16px;
  color: var(--text-3);
  margin: 16px 0 24px;
}
.not-found a {
  display: inline-block;
  padding: 8px 24px;
  background: var(--blue);
  color: var(--white);
  border-radius: 6px;
  font-size: 14px;
}

/* ─── Theme Toggle ──────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
  opacity: .7;
  transition: opacity .15s;
}
.theme-toggle:hover { opacity: 1; }

/* ─── Back to Top ───────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .2s;
  z-index: 100;
}
.back-to-top:hover {
  transform: translateY(-2px);
  color: var(--blue);
}

/* ─── Dark Mode ─────────────────────────────────────────── */
.dark {
  --text:    #e0e0e0;
  --text-2:  #aaa;
  --text-3:  #888;
  --border:  #333;
  --bg:      #1a1a1a;
  --white:   #2a2a2a;
}
.dark body { background: var(--bg); color: var(--text); }
.dark .site-header { background: var(--white); border-color: var(--border); }
.dark .main-nav a:hover, .dark .main-nav a.active { background: #1a3050; }
.dark .hero { background: linear-gradient(135deg, #004499 0%, #002266 100%); }
.dark .detail-wrap, .dark .filter-bar, .dark .prev-next-bar { background: var(--white); }
.dark .detail-meta { background: #333; }
.dark .person-tag { background: #1a3050; }
.dark .person-tag:hover { background: #254070; }
.dark .suggest-list { background: var(--white); border-color: var(--border); }
.dark .suggest-list li:hover { background: #1a3050; }
.dark .back-to-top { background: var(--white); border-color: var(--border); }
.dark mark { background: #665500; }

/* ─── Watch On ──────────────────────────────────────────── */
.watch-on { margin: 24px 0; }
.watch-on h3 { font-size: 15px; margin-bottom: 12px; }
.platform-list { display: flex; flex-wrap: wrap; gap: 10px; }
.platform-btn {
  padding: 8px 20px;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: opacity .15s;
}
.platform-btn:hover { opacity: .85; }
