/* ==========================================
   VOD Detail Page — flat dsn2 layout
   ========================================== */

.page-content {
  flex: 1;
  background: var(--bg-base);
}

/* ===== Shared Wrapper ===== */
.detail-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

/* ===== Top Section: Poster + Info ===== */
.detail-top {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding-bottom: 24px;
}

.detail-poster {
  flex-shrink: 0;
  width: 250px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.detail-poster img {
  width: 100%;
  display: block;
  aspect-ratio: 2/3;
  object-fit: cover;
}
.poster-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.detail-info {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.detail-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-pri);
  margin: 0 0 4px;
  line-height: 1.3;
}
.detail-title-en {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.dtag {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  border: 1px solid var(--border);
  color: var(--text-sec);
  background: var(--bg-card);
}

.detail-score-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 14px;
}
.score-num {
  font-size: 30px;
  font-weight: 700;
  color: #f0b429;
  line-height: 1;
}
.score-count {
  font-size: 12px;
  color: var(--text-muted);
}

.detail-meta {
  margin: 0 0 18px;
}
.dm-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-sec);
}
.dm-row:last-child { border-bottom: none; }
.dm-row dt {
  color: var(--text-muted);
  flex-shrink: 0;
  width: 38px;
  font-weight: 500;
}
.dm-row dd {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.dm-row dd a {
  color: var(--text-sec);
  text-decoration: none;
  margin-right: 4px;
}
.dm-row dd a:hover { color: var(--accent); }
.dm-badge {
  display: inline-block;
  background: var(--bg-elevated);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  margin-right: 4px;
}
.dm-actors a { display: inline; }

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.2s;
}
.detail-btn:hover { opacity: 0.85; }
.detail-btn--play {
  background: var(--accent);
  color: #fff;
}
.detail-btn--dl {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent-hover);
}
.detail-btn--share {
  background: var(--bg-elevated);
  border: 1px solid var(--border-2);
  color: var(--text-1);
}

/* ===== Tabs Section ===== */
.detail-wrap--tabs {
  border-top: 1px solid var(--border);
  padding-top: 0;
}
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.dtab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 18px;
  font-size: 14px;
  color: var(--text-sec);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s;
}
.dtab:hover { color: var(--text-pri); }
.dtab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

#detailDesc {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.75;
}
#detailDesc.desc-collapsed {
  max-height: 4.8em;
  overflow: hidden;
  position: relative;
}
#detailDesc.desc-collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.4em;
  background: linear-gradient(transparent, var(--bg-base));
}
.desc-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

/* ===== Cast List ===== */
.detail-cast-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 8px;
}
.cast-item {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 72px;
}
.cast-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-muted);
}
.cast-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cast-name {
  font-size: 12px;
  color: var(--text-pri);
  display: block;
  text-align: center;
  line-height: 1.3;
  word-break: break-all;
}
.cast-role {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  text-align: center;
}

/* ===== Rate Block ===== */
.rate-block {
  padding: 8px 0 16px;
}
.rate-label {
  font-size: 14px;
  color: var(--text-sec);
  margin: 0 0 12px;
}
.rate-stars {
  display: flex;
  gap: 8px;
  font-size: 30px;
  color: #3a3a3a;
}
.rs {
  cursor: pointer;
  transition: color 0.15s;
}
.rs:hover,
.rs.rs-on { color: #f0b429; }

/* ===== Playlist Section ===== */
.playlist-section {
  margin-bottom: 42px;
}

/* ===== Bottom Layout: Main + Sidebar ===== */
.detail-bottom-layout {
  display: flex;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  align-items: flex-start;
}
.detail-bottom-main {
  flex: 1;
  min-width: 0;
}
.detail-sidebar {
  width: 260px;
  flex-shrink: 0;
}

.detail-section {
  margin-bottom: 32px;
}
.detail-section-hd {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-pri);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.detail-vod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.vod-ad-slot { margin: 8px 0 16px; }

/* ===== Plot List ===== */
.plot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.plot-item {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.plot-desc {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.7;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.plot-ep {
  font-weight: 600;
  color: var(--text-pri);
  margin-right: 6px;
}
.plot-link {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}
.plot-link:hover { color: var(--accent); }
.plot-more-btn {
  display: block;
  text-align: center;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-sec);
  text-decoration: none;
  font-size: 13px;
}
.plot-more-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ===== Share Modal ===== */
.share-modal { display: none; }
.share-modal.is-open { display: block; }
.share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1400;
}
.share-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1401;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 24px;
  width: min(380px, 92vw);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.share-popup-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.share-popup-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-pri);
  margin: 0 0 16px;
}
.share-popup-icons {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.spi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--text-sec);
  font-size: 12px;
  cursor: pointer;
}
.spi-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-pri);
  border: 1px solid var(--border);
}
.share-popup-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.share-popup-link {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-sec);
  resize: none;
  height: 52px;
  box-sizing: border-box;
  display: block;
  margin-bottom: 10px;
}
.share-popup-copy {
  width: 100%;
  padding: 9px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.share-popup-copy:hover { opacity: 0.88; }

/* ===== Playlist Widget ===== */
.playlist-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.playlist-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-pri);
}
.pl-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.pl-sort-btn:hover { color: var(--accent); border-color: var(--accent); }

.playlist-sources {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pl-source-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pl-source-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.playlist-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.playlist-panel { display: none; }
.playlist-panel.is-active { display: block; }

.playlist-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 7px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
}

.playlist-episodes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 4px;
}
.playlist-episodes.episodes-collapsed {
  max-height: 124px;
  overflow: hidden;
}

.episode-btn {
  display: inline-block;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-sec);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.episode-btn:hover { border-color: var(--accent); color: var(--accent); }
.episode-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.episode-more-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 5px 12px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.episode-more-trigger:hover { color: var(--accent); border-color: var(--accent); }

/* ===== Comment Section ===== */
.cmt-total-label { font-size: 13px; font-weight: 400; color: var(--text-muted); margin-left: 6px; }
.cmt-total-label em { color: var(--accent); font-style: normal; }

.mac_comment.cmt-ajax-wrap {
  background: transparent;
  border: none;
  min-height: 60px;
}
.cmt-loading {
  font-size: 13px;
  color: var(--text-muted);
  padding: 24px 0;
  text-align: center;
}
.cmt-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.cmt-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}
.cmt-textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-pri);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.cmt-textarea:focus { border-color: var(--accent); }
.cmt-textarea::placeholder { color: var(--text-muted); }

.cmt-form-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.cmt-verify-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.cmt-verify-input {
  width: 90px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-pri);
  font-size: 12px;
  outline: none;
}
.cmt-captcha-img { height: 30px; border-radius: 3px; cursor: pointer; flex-shrink: 0; }
.cmt-form-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.cmt-remaining { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.cmt-remaining em { color: var(--accent); font-style: normal; }
.cmt-submit-btn {
  padding: 7px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.cmt-submit-btn:hover { opacity: 0.85; }

.cmt-list { display: flex; flex-direction: column; gap: 0; }
.cmt-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cmt-item:last-child { border-bottom: none; }
.cmt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-sec);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.cmt-body { flex: 1; min-width: 0; }
.cmt-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cmt-name { font-size: 13px; font-weight: 600; color: var(--text-pri); }
.cmt-time { font-size: 11px; color: var(--text-muted); }
.cmt-content { font-size: 13px; color: var(--text-sec); line-height: 1.6; margin: 0 0 6px; }

.cmt-child-item {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 2px solid var(--border);
}
.cmt-child-name { font-size: 12px; font-weight: 600; color: var(--text-pri); margin-right: 6px; }

.cmt-actions { display: flex; gap: 12px; margin-top: 4px; }
.cmt-action-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.cmt-action-link:hover { color: var(--accent); }

.cmt-paging {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 16px 0 4px;
}
.cmt-page-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.cmt-page-btn:hover { border-color: var(--accent); color: var(--accent); }
.cmt-page-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cmt-page-btn.is-disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .detail-sidebar { display: none; }
}
@media (max-width: 640px) {
  .detail-top { flex-direction: column; align-items: center; }
  .detail-poster { width: 230px; }
  .detail-info { width: 100%; }
  .detail-bottom-layout { flex-direction: column; padding: 16px 16px 32px; }
  .detail-wrap { padding: 16px 16px 0; }
  .detail-tabs { overflow-x: auto; }
  .cmt-form-footer { flex-direction: column; align-items: stretch; }
  .cmt-form-right { margin-left: 0; justify-content: space-between; }
}
