/* =========================================================
   RTT Story Info Sync UI
   Tách riêng cho page/storyInfo.html, không phụ thuộc topView cũ
   ========================================================= */

.rtt-story-page {
  position: relative;
  overflow-x: hidden;
}

.rtt-story-shell {
  max-width: 1180px;
}

.rtt-story-page .product__container {
  border-radius: 30px;
}

.rtt-story-hero {
  position: relative;
  overflow: hidden;
  padding: 34px !important;
  background:
    radial-gradient(circle at 86% 14%, rgba(180, 154, 221, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(246, 238, 255, 0.82)) !important;
  border: 1px solid rgba(143, 97, 216, 0.18);
  box-shadow: 0 24px 64px rgba(68, 33, 117, 0.13);
}

.rtt-story-bg {
  position: absolute;
  inset: -26px;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.78) 44%, rgba(255, 255, 255, 0.28) 100%),
    var(--story-cover);
  background-size: cover;
  background-position: center;
  filter: blur(20px) saturate(1.12);
  opacity: 0.2;
  transform: scale(1.08);
  pointer-events: none;
}

.rtt-story-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 38%, rgba(244, 134, 212, 0.2), transparent 34%),
    radial-gradient(circle at 14% 12%, rgba(143, 97, 216, 0.16), transparent 32%);
}

.rtt-story-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.rtt-story-cover-col {
  min-width: 0;
}

.rtt-story-cover {
  width: 100% !important;
  height: 430px !important;
  border-radius: 24px !important;
  background-size: cover !important;
  background-position: center !important;
  box-shadow: 0 22px 46px rgba(68, 33, 117, 0.24) !important;
  border: 8px solid rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.rtt-story-support-card {
  display: grid;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(143, 97, 216, 0.14);
  color: #442175;
}

.rtt-story-support-card .gif {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(143, 97, 216, 0.1);
  overflow: hidden;
}

.rtt-story-support-card img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.rtt-story-support-card strong {
  display: block;
  color: #442175;
  font-weight: 900;
}

.rtt-story-support-card small {
  display: block;
  margin-top: 4px;
  color: #7c659c;
  line-height: 1.45;
  font-weight: 700;
}

.rtt-story-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 16px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--rtt-gradient-deep, linear-gradient(135deg, #6b37b6, #8f61d8));
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.rtt-story-title h3 {
  margin: 0 0 8px !important;
  color: #442175 !important;
  font-size: clamp(34px, 5vw, 58px) !important;
  line-height: 1.04 !important;
  font-weight: 900 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rtt-story-title span {
  display: -webkit-box !important;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #8f61d8 !important;
  font-size: 18px !important;
  font-weight: 900 !important;
}

.rtt-story-meta-box {
  margin: 22px 0 18px;
  padding: 18px 18px 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(143, 97, 216, 0.14);
}

.rtt-story-meta-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rtt-story-meta-box li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 10px;
  color: #50316f !important;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.rtt-story-meta-box li span:first-child {
  color: #442175 !important;
  font-weight: 900;
  white-space: nowrap;
}

.rtt-story-tags {
  display: flex !important;
  flex-wrap: wrap;
  margin: 10px 0 20px;
}

.rtt-story-tags a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px !important;
  border-radius: 999px !important;
  background: rgba(143, 97, 216, 0.13) !important;
  border: 1px solid rgba(143, 97, 216, 0.15) !important;
  color: #6b37b6 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  text-decoration: none !important;
}

.rtt-story-desc {
  margin: 0 0 24px !important;
  max-width: 780px;
  color: #56466d !important;
  font-size: 16px !important;
  line-height: 1.82 !important;
  font-weight: 700 !important;
}

.rtt-story-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px !important;
  margin: 0 !important;
}

.rtt-story-actions a,
.rtt-story-actions button {
  min-height: 48px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 999px !important;
  padding: 0 22px !important;
  font-weight: 900 !important;
  text-decoration: none !important;
  border: 0 !important;
  cursor: pointer;
}

.rtt-story-actions .watch-btn,
.rtt-story-actions .follow-btn {
  background: var(--rtt-gradient-deep, linear-gradient(135deg, #6b37b6, #8f61d8)) !important;
  color: #fff !important;
  box-shadow: 0 14px 28px rgba(143, 97, 216, 0.22) !important;
}

.rtt-story-actions .report-btn {
  background: rgba(255, 255, 255, 0.76) !important;
  color: #442175 !important;
  border: 1px solid rgba(143, 97, 216, 0.2) !important;
}

.rtt-rating-box {
  margin-top: 18px !important;
}

.rtt-story-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-top: 30px;
}

.rtt-story-panel {
  padding: 28px !important;
  background: rgba(255, 255, 255, 0.84) !important;
  border: 1px solid rgba(143, 97, 216, 0.14);
  box-shadow: 0 18px 44px rgba(68, 33, 117, 0.09);
}

.rtt-panel-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px !important;
}

.rtt-panel-title h4,
.rtt-panel-title h5 {
  margin: 0 !important;
  color: #442175 !important;
  font-weight: 900 !important;
}

.rtt-panel-title span,
.rtt-panel-title h6 {
  margin: 0 !important;
  color: #8f61d8 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.rtt-chapter-list ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rtt-chapter-list li {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 14px 16px !important;
  border-radius: 18px;
  background: rgba(244, 236, 255, 0.74);
  border: 1px solid rgba(143, 97, 216, 0.15);
  color: #442175;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.rtt-chapter-list li:hover {
  transform: translateY(-2px);
  border-color: rgba(143, 97, 216, 0.3);
  box-shadow: 0 14px 26px rgba(68, 33, 117, 0.1);
}

.rtt-chapter-list .chapter-num {
  min-width: 0;
  color: #442175 !important;
  font-size: 16px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rtt-chapter-list .chapter-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #8f61d8 !important;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.rtt-comment-form textarea {
  min-height: 128px !important;
  border-radius: 20px !important;
  background: rgba(244, 236, 255, 0.78) !important;
  color: #442175 !important;
  border: 1px solid rgba(143, 97, 216, 0.16) !important;
  font-weight: 700;
}

.rtt-comment-form button {
  border-radius: 999px !important;
  background: var(--rtt-gradient-deep, linear-gradient(135deg, #6b37b6, #8f61d8)) !important;
  color: #fff !important;
}

.rtt-comments-list {
  display: grid !important;
  gap: 14px !important;
  margin-top: 18px;
}

.rtt-comments-list .anime__review__item {
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr) !important;
  gap: 14px !important;
  align-items: start !important;
  padding: 14px !important;
  border-radius: 18px;
  background: rgba(244, 236, 255, 0.68);
  border: 1px solid rgba(143, 97, 216, 0.13);
}

.rtt-comments-list .anime__review__item__pic,
.rtt-comments-list .anime__review__item__pic img {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.rtt-comments-list .anime__review__item__text {
  min-width: 0 !important;
  margin: 0 !important;
  float: none !important;
  width: 100% !important;
}

.rtt-comments-list h6 {
  margin: 0 0 6px !important;
  color: #442175 !important;
  font-size: 15px !important;
  font-weight: 900 !important;
}

.rtt-comments-list h6 a {
  color: inherit !important;
  text-decoration: none !important;
}

.rtt-comments-list h6 span {
  color: #8f61d8 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.rtt-comments-list p {
  margin: 0 !important;
  color: #5c4a73 !important;
  line-height: 1.65 !important;
  font-weight: 700 !important;
}

/* Dark mode */
html[data-theme="dark"] .rtt-story-hero,
body.rtt-dark .rtt-story-hero,
body.dark-mode .rtt-story-hero,
html[data-theme="dark"] .rtt-story-panel,
body.rtt-dark .rtt-story-panel,
body.dark-mode .rtt-story-panel {
  background: rgba(31, 21, 50, 0.94) !important;
  color: #f7efff !important;
  border-color: rgba(216, 191, 255, 0.18) !important;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.34) !important;
}

html[data-theme="dark"] .rtt-story-bg,
body.rtt-dark .rtt-story-bg,
body.dark-mode .rtt-story-bg {
  background-image:
    linear-gradient(90deg, rgba(23, 12, 38, 0.98) 0%, rgba(23, 12, 38, 0.82) 46%, rgba(23, 12, 38, 0.42) 100%),
    var(--story-cover);
  opacity: 0.34;
}

html[data-theme="dark"] .rtt-story-title h3,
html[data-theme="dark"] .rtt-panel-title h4,
html[data-theme="dark"] .rtt-panel-title h5,
html[data-theme="dark"] .rtt-chapter-list .chapter-num,
html[data-theme="dark"] .rtt-comments-list h6,
body.rtt-dark .rtt-story-title h3,
body.rtt-dark .rtt-panel-title h4,
body.rtt-dark .rtt-panel-title h5,
body.rtt-dark .rtt-chapter-list .chapter-num,
body.rtt-dark .rtt-comments-list h6,
body.dark-mode .rtt-story-title h3,
body.dark-mode .rtt-panel-title h4,
body.dark-mode .rtt-panel-title h5,
body.dark-mode .rtt-chapter-list .chapter-num,
body.dark-mode .rtt-comments-list h6 {
  color: #f7efff !important;
}

html[data-theme="dark"] .rtt-story-title span,
html[data-theme="dark"] .rtt-panel-title span,
html[data-theme="dark"] .rtt-panel-title h6,
body.rtt-dark .rtt-story-title span,
body.rtt-dark .rtt-panel-title span,
body.rtt-dark .rtt-panel-title h6,
body.dark-mode .rtt-story-title span,
body.dark-mode .rtt-panel-title span,
body.dark-mode .rtt-panel-title h6 {
  color: #d8c5f2 !important;
}

html[data-theme="dark"] .rtt-story-meta-box,
html[data-theme="dark"] .rtt-story-support-card,
html[data-theme="dark"] .rtt-chapter-list li,
html[data-theme="dark"] .rtt-comments-list .anime__review__item,
body.rtt-dark .rtt-story-meta-box,
body.rtt-dark .rtt-story-support-card,
body.rtt-dark .rtt-chapter-list li,
body.rtt-dark .rtt-comments-list .anime__review__item,
body.dark-mode .rtt-story-meta-box,
body.dark-mode .rtt-story-support-card,
body.dark-mode .rtt-chapter-list li,
body.dark-mode .rtt-comments-list .anime__review__item {
  background: rgba(255, 255, 255, 0.075) !important;
  border-color: rgba(216, 191, 255, 0.14) !important;
  color: #f7efff !important;
}

html[data-theme="dark"] .rtt-story-meta-box li,
html[data-theme="dark"] .rtt-story-meta-box li span:first-child,
html[data-theme="dark"] .rtt-story-support-card strong,
html[data-theme="dark"] .rtt-story-desc,
html[data-theme="dark"] .rtt-comments-list p,
body.rtt-dark .rtt-story-meta-box li,
body.rtt-dark .rtt-story-meta-box li span:first-child,
body.rtt-dark .rtt-story-support-card strong,
body.rtt-dark .rtt-story-desc,
body.rtt-dark .rtt-comments-list p,
body.dark-mode .rtt-story-meta-box li,
body.dark-mode .rtt-story-meta-box li span:first-child,
body.dark-mode .rtt-story-support-card strong,
body.dark-mode .rtt-story-desc,
body.dark-mode .rtt-comments-list p {
  color: #e8dcfb !important;
}

html[data-theme="dark"] .rtt-story-support-card small,
body.rtt-dark .rtt-story-support-card small,
body.dark-mode .rtt-story-support-card small {
  color: #d8c5f2 !important;
}

html[data-theme="dark"] .rtt-story-tags a,
body.rtt-dark .rtt-story-tags a,
body.dark-mode .rtt-story-tags a {
  background: rgba(201, 167, 255, 0.16) !important;
  color: #f7efff !important;
  border-color: rgba(201, 167, 255, 0.2) !important;
}

html[data-theme="dark"] .rtt-comment-form textarea,
body.rtt-dark .rtt-comment-form textarea,
body.dark-mode .rtt-comment-form textarea {
  background: rgba(16, 8, 28, 0.72) !important;
  color: #f7efff !important;
  border-color: rgba(201, 167, 255, 0.3) !important;
}

@media (max-width: 991px) {
  .rtt-story-hero-grid {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
  }
  .rtt-story-cover {
    height: 340px !important;
  }
  .rtt-chapter-list ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .rtt-story-shell {
    padding-left: 12px;
    padding-right: 12px;
  }
  .rtt-story-hero,
  .rtt-story-panel {
    padding: 18px !important;
    border-radius: 24px !important;
  }
  .rtt-story-hero-grid {
    grid-template-columns: 1fr;
  }
  .rtt-story-cover {
    max-width: 260px;
    height: 350px !important;
    margin: 0 auto;
  }
  .rtt-story-support-card {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
  .rtt-story-title h3 {
    font-size: 34px !important;
  }
  .rtt-story-meta-box li {
    display: block;
  }
  .rtt-panel-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .rtt-story-actions a,
  .rtt-story-actions button {
    width: 100%;
  }
}
