/* ============ pages.css — 门户 / 媒体库 / 详情 ============ */

/* ---------- 门户 ---------- */
.portal-announcement {
  padding: 11px 16px; border-radius: var(--radius-sm); font-size: 14px;
  font-weight: 600; line-height: 1.5; margin: 0 0 16px; text-align: center;
  box-shadow: var(--shadow); white-space: pre-wrap; word-break: break-word;
}
.portal-hero-label { font-size: 17px; font-weight: 700; margin: 0 0 12px; }

/* ---------- 媒体库 ---------- */
.lib-toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.lib-toolbar select, .lib-toolbar button {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px; color: var(--text);
}
.lib-toolbar .count { font-size: 13px; color: var(--text-2); margin-right: auto; }
.load-more-wrap { text-align: center; margin: 26px 0 10px; }

/* ---------- 详情页 ---------- */
.detail-hero {
  position: relative; min-height: 320px; color: #fff; overflow: hidden;
  border-radius: var(--radius); margin-bottom: 22px;
}
.detail-hero .bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(2px) brightness(.45); transform: scale(1.06);
}
.detail-hero .bg-ph { position: absolute; inset: 0; background: #15171c; }
.detail-hero .hero-body {
  position: relative; display: flex; gap: 26px; align-items: flex-end;
  padding: 30px; min-height: 320px; max-width: 1200px;
}
.detail-hero .poster {
  width: 180px; flex: none; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden;
  background: #23252b; box-shadow: var(--shadow-lg);
}
.detail-hero .poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero .poster .ph { width: 100%; height: 100%; display: grid; place-items: center; color: #8b9098; font-size: 13px; }
.detail-hero .info { flex: 1; min-width: 0; }
.detail-hero .info h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.25; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.detail-hero .info .facts { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: #d7d9dd; margin-bottom: 10px; }
.detail-hero .info .genres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.detail-hero .info .genres span {
  background: rgba(255,255,255,.16); padding: 3px 10px; border-radius: 999px; font-size: 12px;
}
.detail-hero .info .overview { font-size: 14px; line-height: 1.7; color: #e8eaee; max-width: 760px; }
.detail-hero .info .actions { margin-top: 18px; display: flex; gap: 12px; }

/* 季/集 */
.season { margin-bottom: 20px; }
.season .season-name { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ep-card {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  cursor: pointer; transition: all .15s; min-width: 0;
}
.ep-card:hover { background: var(--hover); box-shadow: var(--shadow-lg); }
.ep-card .ep-num {
  width: 40px; height: 40px; flex: none; border-radius: 8px; background: #12141a; color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.ep-card .ep-body { min-width: 0; }
.ep-card .ep-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-card .ep-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.detail-related { margin-top: 28px; }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .detail-hero { min-height: 0; }
  .detail-hero .hero-body { flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px; min-height: 0; }
  .detail-hero .poster { width: 110px; }
  .detail-hero .info h1 { font-size: 21px; }
  .detail-hero .info .overview { font-size: 13px; }
  .detail-hero .info .facts { font-size: 12px; }
  .ep-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 18px; }
}

/* ---------- 分集卡片的观看进度 ---------- */
.ep-card.has-progress .ep-num { background: var(--accent); }
.ep-card.played .ep-num { background: #22c55e; }
.ep-card .ep-body { flex: 1; min-width: 0; }
.ep-card .ep-pct { margin-left: 8px; color: var(--accent); font-weight: 600; }
.ep-card.played .ep-pct { color: #22c55e; }
.ep-card .ep-bar {
  margin-top: 6px; height: 3px; border-radius: 2px; overflow: hidden;
  background: var(--border);
}
.ep-card .ep-bar i {
  display: block; height: 100%; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 6px rgba(230,0,18,.5);
  transition: width .2s;
}
.ep-card.played .ep-bar i { background: #22c55e; box-shadow: none; }
html[data-theme="dark"] .ep-card.played .ep-bar i { background: #22c55e; }
