/* vod_detail.css — 影片詳細頁 + 播放頁共用 */
.color-9 { color: var(--text-3); }

/* ===== 片頭資訊網格 ===== */
.intro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px 8px; margin: 10px 0; }
.ig-item { font-size: 13px; color: var(--text-2); line-height: 1.9; min-width: 0; }
.ig-item .color-9 { margin-right: 2px; }
.ig-full { grid-column: 1 / -1; }
.ig-ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.intro-blurb { font-size: 13px; color: var(--text-2); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; max-height: calc(1.75em * 2); }

/* pill tags: 類型、年代、地區、語言 */
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.detail-tags .dtag { display: inline-flex; align-items: center; padding: 3px 10px; font-size: 12px; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-2); text-decoration: none; line-height: 1.6; }
.detail-tags .dtag a { color: var(--text-2); text-decoration: none; }
.detail-tags .dtag:hover, .detail-tags a.dtag:hover { background: var(--fill); border-color: var(--fill); color: #fff; }
.detail-tags .dtag:hover a { color: #fff; }
@media (max-width: 680px) { .intro-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== Douban score ===== */
.detail-douban { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.detail-douban-num { font-size: 22px; font-weight: 700; color: #F0B429; line-height: 1; }
.detail-douban-stars {
  position: relative; color: var(--border-light); font-size: 18px;
  line-height: 1; white-space: nowrap; letter-spacing: 2px;
}
.detail-douban-stars::before {
  content: '\2605\2605\2605\2605\2605';
  position: absolute; left: 0; top: 0; color: #F0B429;
  width: var(--pct, 0%); overflow: hidden; white-space: nowrap;
}
.detail-douban-label { font-size: 12px; color: var(--text-3); }

/* ===== Detail Tabs ===== */
.detail-tabs { padding: 0; overflow: hidden; }
.detail-tab-nav { display: flex; border-bottom: 2px solid var(--border); padding: 0 16px; }
.dtab-btn { padding: 14px 18px 12px; font-size: 14px; font-weight: 600; color: var(--text-3); background: none; border: none; cursor: pointer; position: relative; transition: color .15s; }
.dtab-btn::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.dtab-btn.is-active { color: var(--accent); }
.dtab-btn.is-active::after { opacity: 1; }
.dtab-panel { display: none; padding: 16px; }
.dtab-panel.is-active { display: block; }

/* ===== Plot tab ===== */
.detail-plot-text { font-size: 13px; color: var(--text-2); line-height: 1.9; white-space: pre-wrap; }
.detail-plot-text.is-clamped { max-height: calc(1.9em * 3); overflow: hidden; -webkit-mask-image: linear-gradient(black 55%, transparent); mask-image: linear-gradient(black 55%, transparent); }
.desc-expand-btn { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 8px; padding: 8px 0; font-size: 13px; color: var(--accent); background: none; border: none; cursor: pointer; }

/* ===== Actor tab ===== */
.actor-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.actor-row:last-child { border-bottom: none; }
.actor-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text-3); flex-shrink: 0; }
.actor-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.actor-role { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.actor-empty { font-size: 13px; color: var(--text-3); padding: 16px 0; text-align: center; }
/* 封面評分角標 */
.cover-score {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,.62); color: #F0B429;
  font-size: 13px; font-weight: 700;
  padding: 3px 7px; border-radius: 4px; line-height: 1.4;
  pointer-events: none;
}
/* 畫質/集數徽章（vod_remarks），跟 .cover 同一個 relative 容器，蓋在右上角，
   跟評分角標（左上角）分開，不要疊在一起 */
.cover-remarks {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.92); color: #1A1A1A;
  font-size: 12px; font-weight: 700;
  padding: 3px 7px; border-radius: 4px; line-height: 1.4;
  pointer-events: none;
}

.actor-grid { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 24px; }
.actor-grid .actor-row:last-child,
.actor-grid .actor-row:nth-last-child(2):nth-child(odd) { border-bottom: none; }
@media (max-width: 767px) { .actor-grid { grid-template-columns: 1fr; } }

/* ===== In-plot Playlist ===== */
.inplot-playlist { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.ipp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ipp-title { font-size: 14px; font-weight: 700; color: var(--text-1); }
.ipp-sort-btn { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); background: none; border: 1px solid var(--border); border-radius: 4px; padding: 4px 8px; cursor: pointer; }
.ipp-sort-btn:hover { color: var(--text-1); border-color: var(--text-2); }
.ipp-src-nav { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; }
.ipp-src-btn { display: flex; align-items: center; gap: 5px; padding: 8px 14px; font-size: 13px; color: var(--text-3); background: none; border: none; cursor: pointer; white-space: nowrap; position: relative; transition: color .15s; flex-shrink: 0; }
.ipp-src-btn::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent); opacity: 0; transition: opacity .15s; }
.ipp-src-btn.is-active { color: var(--accent); }
.ipp-src-btn.is-active::after { opacity: 1; }
.ipp-eps { display: none; }
.ipp-eps.is-active { display: block; }
.ipp-provider { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.ipp-ep-wrap { overflow: hidden; }
.ipp-ep-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.ipp-ep { display: block; padding: 6px 10px; font-size: 13px; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--radius-sm, 4px); text-decoration: none; transition: color .12s, border-color .12s; white-space: nowrap; }
.ipp-ep:hover, .ipp-ep.is-active { color: var(--accent); border-color: var(--accent); }
.ipp-ep.is-active { font-weight: 600; }
.ipp-ep-toggle { display: flex; align-items: center; gap: 4px; margin: 10px auto 0; font-size: 13px; color: var(--accent); background: none; border: none; cursor: pointer; }

/* ===== Rating block ===== */
.rate-block { display: flex; align-items: center; gap: 12px; padding: 6px 0 14px; flex-wrap: wrap; }
.rate-label { font-size: 13px; color: var(--text-2); white-space: nowrap; margin: 0; }
.rate-stars { display: flex; gap: 5px; font-size: 26px; color: var(--border-light); cursor: pointer; }
.rs { cursor: pointer; transition: color .15s; }
.rs:hover, .rs.rs-on { color: #f0b429; }
.rate-result { font-size: 12px; color: var(--text-3); }

/* ===== Sidebar ===== */
.sidebar-topic-grid { display: flex; flex-direction: column; gap: 10px; }

/* ===== Desc expand ===== */
.desc-collapsed { max-height: 80px; overflow: hidden; -webkit-mask-image: linear-gradient(black 40%, transparent); mask-image: linear-gradient(black 40%, transparent); }
.desc-expanded { max-height: none; mask-image: none; -webkit-mask-image: none; }

.share-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7); z-index: 600;
  align-items: center; justify-content: center;
}
.share-modal-overlay.is-open { display: flex; }
.share-modal-box {
  background: var(--bg-card); border-radius: 10px; padding: 20px 20px 16px;
  width: 300px; max-width: calc(100vw - 32px);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.share-modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.share-modal-title { font-size: 15px; font-weight: 700; color: var(--text-1); }
.share-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 16px; line-height: 1; padding: 2px 4px;
}
.share-modal-close:hover { color: var(--text-1); }
.share-icon-row { display: flex; gap: 20px; justify-content: center; margin-bottom: 18px; }
.share-icon-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
}
.share-icon-circle {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg-elevated); color: var(--text-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.share-icon-label { font-size: 12px; color: var(--text-2); }
.share-link-label { font-size: 12px; color: var(--text-3); margin: 0 0 6px; }
.share-link-text {
  width: 100%; padding: 8px 10px; font-size: 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-2); resize: none; line-height: 1.5;
  box-sizing: border-box; outline: none; word-break: break-all;
}
.share-copy-btn {
  display: block; width: 100%; margin-top: 12px;
  padding: 11px; background: var(--fill); color: #fff;
  border: none; border-radius: 6px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background .15s;
}
.share-copy-btn:hover { background: var(--fill-hover); }

/* ===== 評論區 Comment ===== */
.detail-section { margin-bottom: 24px; }
.detail-section-hd {
  font-size: 16px; font-weight: 700; color: var(--text-1);
  margin: 0 0 16px;
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}
.cmt-total-label { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 6px; }
.cmt-total-label em { font-style: normal; color: var(--accent); }
.cmt-loading { font-size: 13px; color: var(--text-3); padding: 16px 0; }

/* 覆蓋 static/home.css 的 .mac_comment 預設樣式 */
.mac_comment { border: none !important; background: transparent !important; padding: 0 !important; margin-top: 0 !important; }

/* 評論表單 */
.cmt-form { margin-bottom: 20px; }
.cmt-textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-1); font-size: 14px;
  font-family: "PingFang SC","Microsoft YaHei",Arial,sans-serif;
  resize: vertical; outline: none; line-height: 1.6;
  transition: border-color .18s; display: block; min-height: 88px;
  margin-bottom: 10px; box-sizing: border-box;
}
.cmt-textarea:focus { border-color: var(--accent); }
.cmt-textarea::placeholder { color: var(--text-3); }
.cmt-form-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.cmt-form-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.cmt-verify-row { display: flex; align-items: center; gap: 8px; }
.cmt-verify-input {
  padding: 7px 10px; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-1); font-size: 13px; outline: none; width: 100px;
}
.cmt-verify-input:focus { border-color: var(--accent); }
.cmt-captcha-img { height: 36px; border-radius: 3px; cursor: pointer; vertical-align: middle; }
.cmt-remaining { font-size: 12px; color: var(--text-3); }
.cmt-remaining em { font-style: normal; color: var(--accent); }
.cmt-submit-btn, .comment_submit {
  display: inline-flex !important; align-items: center;
  padding: 8px 22px !important; background: var(--fill) !important; color: #fff !important;
  border: none !important; border-radius: 50px !important; font-size: 13px !important;
  font-weight: 700 !important; cursor: pointer; white-space: nowrap;
  transition: background .18s; line-height: normal !important;
}
.cmt-submit-btn:hover, .comment_submit:hover { background: var(--fill-hover) !important; }

/* 評論列表 */
.cmt-list { display: flex; flex-direction: column; }
.cmt-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cmt-item:last-child { border-bottom: none; }
/* 比照參考網站：一律用通用人像圖示（沒有真的頭像上傳機制），不是取名字第一個字當文字頭像 */
.cmt-avatar {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-elevated); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; overflow: hidden;
}
.cmt-body { flex: 1; min-width: 0; }
.cmt-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cmt-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.cmt-time { font-size: 11px; color: var(--text-3); }
.cmt-content { font-size: 14px; color: var(--text-2); line-height: 1.7; word-break: break-all; margin: 0; }
.cmt-child-item {
  margin-top: 8px; padding: 8px 12px;
  background: var(--bg-elevated); border-radius: var(--radius); font-size: 13px;
}
.cmt-child-name { font-weight: 600; color: var(--text-1); margin-right: 6px; }
.cmt-actions { margin-top: 8px; display: flex; gap: 12px; }
.cmt-action-link { font-size: 12px; color: var(--text-3); text-decoration: none; transition: color .15s; }
.cmt-action-link:hover { color: var(--accent); }
.cmt-empty { font-size: 13px; color: var(--text-3); padding: 24px 0; text-align: center; }

@media (max-width: 767px) {
  .cmt-form-footer { flex-direction: column; align-items: flex-start; }
  .cmt-form-right { margin-left: 0; }
}

/* ===== 分集劇情 ===== */
.plot-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.plot-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.plot-desc {
  /* flex item 裡放 white-space:nowrap 文字，一定要加 min-width:0，
     不然長文字會把 flex-basis 撐開，見 CLAUDE.md §30 同一個坑 */
  flex: 1; min-width: 0;
  font-size: 13px; color: var(--text-2); line-height: 1.7; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plot-ep { font-weight: 700; color: var(--text-1); margin-right: 5px; }
.plot-link {
  flex-shrink: 0;
  display: inline-block; font-size: 12px; color: var(--text-3);
  font-weight: 600; text-decoration: none; transition: color .18s;
}
.plot-link:hover { color: var(--accent); }
.plot-more-btn {
  display: block; text-align: center; padding: 10px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--accent); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: background .18s, color .18s;
}
.plot-more-btn:hover { background: var(--fill); color: #fff; }
