/* ==========================================================================
   短剧频道 (/drama), ported from the ai-duanju branch (ai_drama.css)
   - 列表 / 详情 / 标签 / 搜索：跟随站点浅色主题（--dx-base1-color #fafafa、主色 --dx-primary-color #2984fc）
   - 分集播放页 .ai-play-page：沉浸式深色，蓝色强调
   断点与站点一致：md = 786px
   ========================================================================== */

:root {
  --ai-primary: var(--dx-primary-color, #2984fc);
  --ai-primary-soft: rgba(41, 132, 252, .1);
  --ai-primary-line: rgba(41, 132, 252, .28);
  --ai-bg: var(--dx-base1-color, #fafafa);
  --ai-card: #fff;
  --ai-text: var(--dx-font4-color, #080808);
  --ai-text-2: var(--dx-font3-color, #333);
  --ai-text-3: var(--dx-font2-color, #848484);
  --ai-line: var(--dx-border-color, rgba(8, 8, 8, .1));
  --ai-danger: var(--dx-red-color, #e44545);
  --ai-gold: #f5a623;
  --ai-radius: 8px;
  --ai-shadow: 0 1px 2px rgba(8, 8, 8, .04), 0 4px 14px rgba(8, 8, 8, .05);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---------- 页面骨架：宽度跟随站点容器 .dx-container（移动端 12px 内边距，桌面 1280px） ---------- */
.ai-page { background: var(--ai-bg); color: var(--ai-text); }
.ai-wrap {
  padding-bottom: 32px;
  font-size: 14px;
  line-height: 1.6;
}
@media (min-width: 786px) {
  .ai-wrap { padding-bottom: 48px; }
}

.ai-crumb { padding: 12px 0 4px; font-size: 12px; color: var(--ai-text-3); }
.ai-crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ai-crumb li { display: inline-flex; align-items: center; min-width: 0; }
.ai-crumb li + li::before { content: '/'; margin-right: 4px; color: #c5c5c5; }
.ai-crumb a:hover { color: var(--ai-primary); }
.ai-crumb [aria-current] { color: var(--ai-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

.ai-section { margin-top: 20px; }
.ai-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ai-sec-head .ai-h2 { margin-bottom: 0; }
.ai-sec-head a { flex-shrink: 0; font-size: 13px; color: var(--ai-text-3); }
.ai-sec-head a:hover { color: var(--ai-primary); }
/* 区块标题：左侧色条（同线上 dx-067 AI 短剧） */
.ai-h2,
.ai-detail-info h2, .ai-detail-section h2, .ai-comments h2 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px; font-size: 16px; font-weight: 600; color: var(--ai-text);
}
.ai-h2::before,
.ai-detail-info h2::before, .ai-detail-section h2::before, .ai-comments h2::before {
  content: ''; flex-shrink: 0; width: 4px; height: 15px; border-radius: 2px; background: var(--ai-primary);
}
.ai-h2 small { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--ai-text-3); }
@media (min-width: 786px) { .ai-h2 { font-size: 18px; } }

/* ---------- 按钮 ---------- */
.ai-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 36px; padding: 0 14px;
  border: 1px solid var(--ai-line); border-radius: 18px;
  background: #fff; color: var(--ai-text-2);
  font-size: 14px; line-height: 1; white-space: nowrap;
  cursor: pointer; transition: color .15s, background-color .15s, border-color .15s, opacity .15s;
}
.ai-btn:hover { border-color: var(--ai-primary-line); color: var(--ai-primary); }
.ai-btn:focus-visible, .ai-star:focus-visible, .ai-link-btn:focus-visible { outline: 2px solid var(--ai-primary); outline-offset: 2px; }
.ai-btn:disabled, .ai-btn.is-loading { opacity: .6; cursor: progress; }
.ai-btn--primary { background: var(--ai-primary); border-color: var(--ai-primary); color: #fff; }
.ai-btn--primary:hover { color: #fff; opacity: .9; }
.ai-btn--lg { min-height: 40px; padding: 0 22px; font-weight: 600; }
.ai-btn--block { display: flex; width: 100%; margin-top: 12px; }
.ai-btn.is-active { background: var(--ai-primary-soft); border-color: var(--ai-primary-line); color: var(--ai-primary); }
.ai-link-btn { padding: 4px 0; border: 0; background: none; color: var(--ai-primary); font-size: 13px; cursor: pointer; }

/* ---------- 横幅 / 介绍 ---------- */
.ai-banner {
  position: relative; display: block; margin-top: 8px;
  aspect-ratio: 16 / 5; overflow: hidden;
  border-radius: var(--ai-radius); background: #e8eef8;
}
.ai-banner img { width: 100%; height: 100%; object-fit: cover; }
.ai-banner__text {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; padding: 24px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55)); color: #fff;
}
.ai-banner__text strong { font-size: 16px; }
.ai-banner__text small { font-size: 12px; opacity: .85; }

.ai-intro { margin-top: 12px; }
.ai-intro h1 { font-size: 20px; font-weight: 700; line-height: 1.35; color: var(--ai-text); }
.ai-intro h1 em { font-style: normal; color: var(--ai-primary); }
.ai-intro p { margin-top: 6px; color: var(--ai-text-3); font-size: 13px; }
.ai-intro__meta b { color: var(--ai-primary); }
.ai-intro h1 small { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--ai-text-3); }
@media (min-width: 786px) { .ai-intro h1 { font-size: 24px; } }

/* ---------- 排序（上架时间 / 浏览量 / 热度，WebDramaService::sort_links） ---------- */
.ai-sorts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; }
.ai-sorts a, .ai-sorts span { padding: 4px 12px; border-radius: 14px; border: 1px solid transparent; color: var(--ai-text-3); }
.ai-sorts a:hover { color: var(--ai-primary); }
.ai-sorts .is-active { color: var(--ai-primary); background: var(--ai-primary-soft); border-color: var(--ai-primary-line); }

/* ---------- 分类 Tab：纯文字下划线，移动端横向滚动（同线上 dx-067） ---------- */
.ai-cats {
  display: flex; gap: 20px; margin-top: 14px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--ai-line);
}
.ai-cats::-webkit-scrollbar { display: none; }
.ai-cats a {
  flex-shrink: 0; padding: 10px 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--ai-text-3); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.ai-cats a:hover { color: var(--ai-text); }
.ai-cats a.is-active { color: var(--ai-text); font-weight: 600; border-bottom-color: var(--ai-primary); }
@media (min-width: 786px) { .ai-cats { gap: 26px; } .ai-cats a { padding: 12px 0; font-size: 15px; } }
.ai-cats + .ai-sorts { margin-top: 12px; }

/* ---------- 卡片网格：5 / 4 / 3 / 2 列，9:16 竖版海报 + 信息栏（同线上 dx-067） ---------- */
.ai-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 14px; }
.ai-grid > li { min-width: 0; }
@media (max-width: 1199px) { .ai-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 899px) { .ai-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 785px) { .ai-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.ai-grid__full { grid-column: 1 / -1; }
.drama-card {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--ai-radius); background: var(--ai-card); border: 1px solid var(--ai-line); color: inherit;
  transition: transform .22s, border-color .22s, box-shadow .22s;
}
.drama-card:hover { transform: translateY(-4px); border-color: var(--ai-primary-line); box-shadow: 0 8px 24px rgba(8, 8, 8, .08); }
.drama-card__poster { position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: #eef1f6; }
.drama-card__poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drama-card__poster::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .5)); }
.drama-card__eps { position: absolute; left: 8px; bottom: 8px; z-index: 2; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.drama-card__play { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.drama-card:hover .drama-card__play { opacity: 1; }
.drama-card__play span {
  width: 48px; height: 48px; border-radius: 50%; background: rgba(41, 132, 252, .9);
  display: flex; align-items: center; justify-content: center; transform: scale(.85); transition: transform .2s;
}
.drama-card:hover .drama-card__play span { transform: scale(1); }
.drama-card__play span::after { content: ''; margin-left: 4px; border-left: 14px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.drama-card__info { padding: 10px 10px 12px; }
.drama-card__info h2, .drama-card__info h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ai-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drama-card:hover .drama-card__info h2, .drama-card:hover .drama-card__info h3 { color: var(--ai-primary); }
.drama-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 4px; font-size: 12px; color: var(--ai-text-3); }
.drama-card__meta > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drama-card__meta .drama-score { flex-shrink: 0; font-weight: 600; color: var(--ai-gold); }
@media (max-width: 785px) { .drama-card__info { padding: 8px 8px 10px; } }

/* ---------- 分页 ---------- */
.ai-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; font-size: 13px; }
.ai-pager > a, .ai-pager > span {
  min-width: 34px; height: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: #fff; border: 1px solid var(--ai-line); color: var(--ai-text-2);
}
.ai-pager > a:hover { color: var(--ai-primary); border-color: var(--ai-primary-line); }
.ai-pager > .is-active { background: var(--ai-primary); border-color: var(--ai-primary); color: #fff; }
.ai-pager > .is-disabled { color: #c5c5c5; }
.ai-pager > .dots { border: 0; background: none; }
.ai-pager__goto { display: inline-flex; gap: 4px; margin-left: 4px; }
.ai-pager__goto input { width: 56px; height: 34px; padding: 0 6px; border: 1px solid var(--ai-line); border-radius: 6px; background: #fff; text-align: center; }
.ai-pager__goto button { height: 34px; padding: 0 12px; border-radius: 6px; background: var(--ai-primary); color: #fff; }

/* ---------- 标签云 ---------- */
.ai-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-tag-cloud a {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px;
  border-radius: 14px; background: #fff; border: 1px solid var(--ai-line);
  color: var(--ai-text-2); font-size: 13px; line-height: 1.3;
}
.ai-tag-cloud a:hover, .ai-tag-cloud a.is-active { color: var(--ai-primary); border-color: var(--ai-primary-line); background: var(--ai-primary-soft); }
.ai-tag-cloud a.is-hot { border-color: var(--ai-primary-line); color: var(--ai-primary); }
.ai-tag-cloud .tag-count { font-size: 11px; color: var(--ai-text-3); }
.ai-tag-cloud--sm a { padding: 3px 10px; font-size: 12px; background: var(--ai-primary-soft); border-color: transparent; color: var(--ai-primary); }

/* ---------- 搜索 ---------- */
.ai-search { display: flex; gap: 8px; margin-top: 14px; }
.ai-search input {
  flex: 1; min-width: 0; height: 40px; padding: 0 14px;
  border: 1px solid var(--ai-line); border-radius: 20px; background: #fff; font-size: 14px;
}
.ai-search input:focus { outline: none; border-color: var(--ai-primary); box-shadow: 0 0 0 3px var(--ai-primary-soft); }
.ai-search .ai-btn { min-height: 40px; border-radius: 20px; padding: 0 20px; }
.ai-hot-words { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; font-size: 13px; color: var(--ai-text-3); }
.ai-hot-words a { color: var(--ai-text-2); }
.ai-hot-words a:hover { color: var(--ai-primary); }

/* ---------- 空状态 ---------- */
.ai-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin-top: 16px; padding: 36px 16px; text-align: center;
  background: #fff; border-radius: var(--ai-radius); box-shadow: var(--ai-shadow);
}
.ai-empty__icon { width: 48px; height: 48px; fill: none; stroke: var(--ai-primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.ai-empty h2, .ai-empty h3 { font-size: 16px; font-weight: 600; color: var(--ai-text); }
.ai-empty p { font-size: 13px; color: var(--ai-text-3); }
.ai-empty .ai-btn { margin-top: 8px; }

/* ---------- 详情（同线上 dx-067：左封面 / 右信息区，手机端上下堆叠） ---------- */
.ai-detail-title { margin: 12px 0 4px; font-size: 20px; font-weight: 700; line-height: 1.35; color: var(--ai-text); }
@media (min-width: 786px) { .ai-detail-title { font-size: 26px; } }
.ai-notice {
  display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 2px; padding: 5px 12px;
  border: 1px solid var(--ai-primary-line); border-radius: 999px;
  background: var(--ai-primary-soft); color: var(--ai-primary); font-size: 12px; line-height: 1.4;
}
.ai-detail-layout { display: flex; gap: 32px; margin: 20px 0; }
.ai-detail-cover {
  flex: 0 0 300px; position: relative; margin: 0;
  aspect-ratio: 9 / 16; overflow: hidden; border-radius: 12px; background: #eef1f6;
}
.ai-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.ai-detail-cover .badge {
  position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 4px;
  background: var(--ai-primary); color: #fff; font-size: 12px; font-weight: 600;
}
.ai-detail-body { flex: 1; min-width: 0; }
.ai-detail-info { margin: 0 0 20px; }
.ai-detail-section h2 small { font-size: 13px; font-weight: 400; color: var(--ai-text-3); }

.synopsis-text { font-size: 14px; line-height: 1.7; color: var(--ai-text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.synopsis-text.is-expanded { display: block; -webkit-line-clamp: unset; }
.synopsis-toggle { padding: 6px 0; border: 0; background: none; color: var(--ai-primary); font-size: 13px; cursor: pointer; }

.ai-detail-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.ai-detail-rating strong { font-size: 32px; font-weight: 700; line-height: 1; color: var(--ai-gold); }
.ai-detail-rating .frac, .ai-detail-rating .count { font-size: 13px; color: var(--ai-text-3); }
.ai-detail-rating .stars { display: flex; gap: 2px; }
.rate-thanks { font-size: 13px; color: var(--ai-primary); }
.ai-star { padding: 0; border: 0; background: none; font-size: 20px; line-height: 1; color: #dcdfe6; cursor: pointer; transition: color .1s, transform .1s; }
.ai-star.is-on { color: var(--ai-gold); }
.ai-star:active { transform: scale(.9); }
.ai-star:focus-visible, .synopsis-toggle:focus-visible, .ai-detail-actions > :focus-visible { outline: 2px solid var(--ai-primary); outline-offset: 2px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { padding: 5px 12px; border-radius: 999px; background: var(--ai-card); border: 1px solid var(--ai-line); color: var(--ai-text-2); font-size: 12px; transition: color .15s, background-color .15s, border-color .15s; }
a.pill:hover { color: var(--ai-primary); border-color: var(--ai-primary-line); background: var(--ai-primary-soft); }

.ai-detail-meta dl { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 14px; }
.ai-detail-meta dt { color: var(--ai-text-3); }
.ai-detail-meta dd { margin: 0; color: var(--ai-text); word-break: break-word; }
.ai-detail-meta dd a { color: var(--ai-primary); }

.ai-detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 4px; }
.ai-detail-actions .btn-primary,
.ai-detail-actions .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 12px 20px; border: 1px solid var(--ai-line); border-radius: 8px;
  font-size: 14px; line-height: 1.2; white-space: nowrap; cursor: pointer;
  transition: opacity .15s, color .15s, background-color .15s, border-color .15s;
}
.ai-detail-actions .btn-primary { padding: 12px 32px; border-color: var(--ai-primary); background: var(--ai-primary); color: #fff; font-size: 16px; font-weight: 600; }
.ai-detail-actions .btn-primary:hover { opacity: .85; }
.ai-detail-actions .btn-secondary { background: var(--ai-card); color: var(--ai-text); }
.ai-detail-actions .btn-secondary:hover { border-color: var(--ai-primary-line); color: var(--ai-primary); }
.ai-detail-actions .btn-secondary.is-active { border-color: var(--ai-primary-line); background: var(--ai-primary-soft); color: var(--ai-primary); }
.ai-detail-actions .btn-secondary:disabled, .ai-detail-actions .btn-secondary.is-loading { opacity: .6; cursor: progress; }

.ai-detail-section { margin: 32px 0; }
.ai-ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.ai-detail-section .ai-ep-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.ai-ep-grid a {
  display: flex; align-items: center; justify-content: center; height: 40px;
  border: 1px solid var(--ai-line); border-radius: 6px; background: var(--ai-card);
  color: var(--ai-text); font-size: 14px; font-variant-numeric: tabular-nums;
  transition: color .15s, background-color .15s, border-color .15s;
}
.ai-ep-grid a:hover { border-color: var(--ai-primary-line); color: var(--ai-primary); }
.ai-ep-grid a.is-active { background: var(--ai-primary); border-color: var(--ai-primary); color: #fff; font-weight: 600; }

@media (max-width: 785px) {
  .ai-detail-layout { flex-direction: column; gap: 20px; margin: 16px 0; }
  .ai-detail-cover { flex: none; width: 100%; max-width: 260px; margin: 0 auto; align-self: center; }
  .ai-detail-meta dl { grid-template-columns: 72px minmax(0, 1fr); font-size: 13px; }
  .ai-detail-actions { gap: 8px; }
  .ai-detail-actions .btn-primary { flex: 1 0 100%; padding: 12px 20px; }
  .ai-detail-actions .btn-secondary { flex: 1; min-width: 0; padding: 10px 6px; font-size: 13px; }
  .ai-detail-section .ai-ep-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ai-detail-section { margin: 24px 0; }
}

/* ---------- 评论（输入框 + 发表按钮同一行） ---------- */
.ai-comments { margin: 32px 0; }
@media (max-width: 785px) { .ai-comments { margin: 24px 0; } }
.ai-comment-form { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ai-comment-input {
  flex: 1; min-width: 0; height: 40px; padding: 9px 16px; resize: none; overflow: hidden;
  border: 1px solid var(--ai-line); border-radius: 20px; background: var(--ai-card);
  color: var(--ai-text); font-size: 14px; line-height: 20px; outline: none;
}
.ai-comment-input:focus { border-color: var(--ai-primary); box-shadow: 0 0 0 3px var(--ai-primary-soft); }
.ai-comment-form button { flex-shrink: 0; height: 40px; padding: 0 26px; border: 0; border-radius: 20px; background: var(--ai-primary); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.ai-comment-form button:disabled { opacity: .6; cursor: progress; }
.ai-comment-form__count { flex-shrink: 0; font-size: 12px; color: var(--ai-text-3); }
.ai-comment-form__count.is-over { color: var(--ai-danger); }
@media (max-width: 785px) { .ai-comment-form__count { display: none; } .ai-comment-form button { padding: 0 18px; } }
.ai-comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--ai-line); }
.ai-comment__avatar { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #eef1f6; }
.ai-comment__body { flex: 1; min-width: 0; }
.ai-comment__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--ai-text-3); }
.ai-comment__head b { font-weight: 600; color: var(--ai-primary); }
.ai-comment__text { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--ai-text); word-break: break-word; }
.ai-comment__like { align-self: flex-start; flex-shrink: 0; padding: 4px 8px; border: 0; border-radius: 12px; background: none; font-size: 12px; color: var(--ai-text-3); cursor: pointer; }
.ai-comment__like:hover, .ai-comment__like.is-active { color: var(--ai-primary); background: var(--ai-primary-soft); }
.ai-comment-empty { padding: 16px 0; text-align: center; font-size: 13px; color: var(--ai-text-3); }
.ai-comment-error { padding: 12px 0; text-align: center; font-size: 13px; color: var(--ai-danger); }
.ai-comment-more { display: block; margin: 14px auto 0; padding: 7px 22px; border: 1px solid var(--ai-line); border-radius: 999px; background: var(--ai-card); color: var(--ai-text-3); font-size: 13px; cursor: pointer; }
.ai-comment-more:hover { color: var(--ai-primary); border-color: var(--ai-primary-line); }

/* ---------- 分享弹窗（两种主题共用，内容区始终浅色） ---------- */
.ai-share {
  position: fixed; inset: 0; z-index: 2100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .5); animation: ai-fade .2s ease;
}
.ai-share[hidden] { display: none; }
@media (min-width: 786px) { .ai-share { align-items: center; } }
.ai-share__box {
  width: 100%; max-width: 420px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 14px 14px 0 0; background: #fff; color: var(--ai-text);
  animation: ai-up .22s ease;
}
@media (min-width: 786px) { .ai-share__box { border-radius: 14px; } }
.ai-share__head { display: flex; align-items: center; justify-content: space-between; }
.ai-share__head h3 { font-size: 16px; font-weight: 600; }
.ai-share__close { width: 32px; height: 32px; border: 0; background: none; font-size: 16px; color: var(--ai-text-3); cursor: pointer; }
.ai-share__channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.ai-share__channels button { height: 40px; border-radius: 8px; background: var(--ai-primary-soft); color: var(--ai-primary); font-size: 13px; }
.ai-share__copy { display: flex; gap: 8px; margin-top: 12px; }
.ai-share__copy input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--ai-line); border-radius: 6px; font-size: 12px; color: var(--ai-text-2); background: #f6f7f9; }
.ai-share__copy button { padding: 0 14px; border-radius: 6px; background: var(--ai-primary); color: #fff; }
.ai-share__tip { min-height: 18px; margin-top: 8px; font-size: 12px; color: var(--ai-primary); }

/* ---------- 轻提示 ---------- */
.ai-toast {
  position: fixed; left: 50%; top: 40%; z-index: 2200;
  max-width: 80vw; padding: 10px 16px; border-radius: 8px;
  background: rgba(17, 24, 39, .88); color: #fff; font-size: 14px; text-align: center;
  transform: translate(-50%, -50%) scale(.96); opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.ai-toast.is-show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@keyframes ai-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ai-up { from { transform: translateY(24px); } to { transform: none; } }
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   分集播放页：沉浸式深色 + 蓝色强调
   ========================================================================== */
.ai-play-page {
  --ai-dark: #0b0f17;
  --ai-dark-2: #151b26;
  --ai-dark-line: rgba(255, 255, 255, .12);
  --ai-dark-text: rgba(255, 255, 255, .92);
  --ai-dark-text-2: rgba(255, 255, 255, .62);
  margin: 0; height: 100vh; height: 100dvh; overflow: hidden;
  background: var(--ai-dark); color: var(--ai-dark-text);
  overscroll-behavior: none;
}
/* 站点全局悬浮菜单会压住右侧操作栏；播放页自带返回/选集，直接隐藏 */
.ai-play-page .fixed-menu { display: none !important; }
.ai-feed { position: relative; height: 100%; display: flex; justify-content: center; }
.ai-stage {
  /* xgplayer paints its 48px control bar at the bottom of .ai-player; every stage
     overlay (info / rail / prev-next nav) stops above it so volume, progress and
     fullscreen stay clickable and the volume slider (92px above the bar) is clear */
  --ai-ctrl-h: 48px;
  position: relative; width: 100%; height: 100%; overflow: hidden; background: #000;
  transition: opacity .25s;
}
@media (min-width: 786px) { .ai-stage { max-width: calc(100dvh * 9 / 16 + 120px); } .ai-stage.is-h { max-width: 960px; } }
.ai-stage.is-switching { opacity: .4; }

.ai-stage__top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 8px 24px;
  background: linear-gradient(rgba(0, 0, 0, .6), transparent);
  pointer-events: none;
}
.ai-stage__top > * { pointer-events: auto; }
.ai-icon-btn {
  flex-shrink: 0; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer;
}
.ai-icon-btn:hover { background: rgba(41, 132, 252, .35); }
.ai-icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-stage__crumb { flex: 1; min-width: 0; font-size: 12px; color: var(--ai-dark-text-2); }
.ai-stage__crumb ol { display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; }
.ai-stage__crumb li { flex-shrink: 0; }
.ai-stage__crumb li:nth-last-child(2) { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ai-stage__crumb li + li::before { content: '›'; margin-right: 4px; opacity: .6; }
.ai-stage__crumb a:hover { color: #fff; }
.ai-stage__crumb [aria-current] { color: #fff; }
@media (max-width: 785px) { .ai-stage__crumb li:nth-child(-n+2) { display: none; } }

.ai-player { position: absolute; inset: 0; z-index: 1; }
.ai-player .xgplayer { background: #000; }
.ai-player__state {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; color: var(--ai-dark-text-2); text-align: center; padding: 0 24px;
}
.ai-player__state[hidden] { display: none; }
.ai-player__state.is-error { color: #ff9a9a; pointer-events: auto; background: rgba(0, 0, 0, .6); }
.ai-player__state.is-error .ai-spinner { display: none; }
.ai-player__state a { color: #8fbfff; pointer-events: auto; }
.ai-player__state .ai-btn { margin-top: 4px; background: var(--ai-primary); border-color: var(--ai-primary); color: #fff; }
.ai-spinner { width: 28px; height: 28px; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--ai-primary); border-radius: 50%; animation: ai-spin .8s linear infinite; }

.ai-stage__info {
  position: absolute; left: 0; right: 72px; bottom: 0; z-index: 4;
  padding: 40px 14px calc(56px + var(--ai-ctrl-h) + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  pointer-events: none;
}
.ai-stage__info a { pointer-events: auto; }
.ai-stage__badges { display: flex; gap: 6px; }
.ai-badge { padding: 1px 8px; border-radius: 4px; background: var(--ai-primary); color: #fff; font-size: 11px; line-height: 1.6; }
.ai-badge--ghost { background: rgba(255, 255, 255, .16); }
.ai-stage__title { margin-top: 6px; font-size: 17px; font-weight: 700; line-height: 1.35; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ai-stage__ep-title { margin-top: 2px; font-size: 13px; color: var(--ai-dark-text-2); }
.ai-stage__tags { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12px; }
.ai-stage__tags a { color: #8fbfff; }

.ai-rail {
  position: absolute; right: 8px; bottom: calc(96px + var(--ai-ctrl-h) + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; flex-direction: column; gap: 14px;
}
.ai-rail__btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; width: 56px;
  border: 0; background: none; color: #fff; font-size: 11px; cursor: pointer;
}
.ai-rail__btn svg {
  width: 44px; height: 44px; padding: 10px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round;
  transition: background-color .15s, color .15s, transform .15s;
}
.ai-rail__btn:hover svg { background: rgba(41, 132, 252, .35); }
.ai-rail__btn:active svg { transform: scale(.9); }
.ai-rail__btn.is-active { color: #4d9bff; }
.ai-rail__btn.is-active svg { fill: currentColor; background: rgba(41, 132, 252, .2); }
.ai-rail__btn:disabled { opacity: .6; }

.ai-stage__nav {
  position: absolute; left: 0; right: 0; bottom: calc(var(--ai-ctrl-h) + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; justify-content: center; gap: 16px;
  padding: 10px 12px;
  font-size: 12px; color: var(--ai-dark-text-2);
  pointer-events: none; /* only the links take clicks; the band itself lets the player through */
}
.ai-stage__nav a, .ai-stage__nav span { pointer-events: auto; }
.ai-stage__nav a { padding: 4px 12px; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; }
.ai-stage__nav a:hover { background: var(--ai-primary); }
.ai-stage__nav span { padding: 4px 0; }

.ai-sheet-mask { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .5); animation: ai-fade .2s; }
.ai-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  max-height: 60vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  border-radius: 14px 14px 0 0; background: var(--ai-dark-2); color: var(--ai-dark-text);
  animation: ai-up .22s ease;
}
@media (min-width: 786px) { .ai-sheet { left: 50%; right: auto; width: 480px; transform: translateX(-50%); } }
.ai-sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ai-sheet__head h2 { font-size: 15px; font-weight: 600; }
.ai-play-page .ai-ep-grid a { background: rgba(255, 255, 255, .06); border-color: var(--ai-dark-line); color: var(--ai-dark-text); }
.ai-play-page .ai-ep-grid a:hover { border-color: var(--ai-primary); color: #8fbfff; }
.ai-play-page .ai-ep-grid a.is-active { background: var(--ai-primary); border-color: var(--ai-primary); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .ai-share, .ai-share__box, .ai-sheet, .ai-sheet-mask, .ai-spinner { animation: none; }
  .drama-card, .drama-card__play, .drama-card__play span, .ai-stage { transition: none; }
}
