/*!
 * 穹顶之镜 · 游戏专题增强层样式
 * qdm-library-topic-enhance-20261003.css
 * 与 qdm-library-topic-enhance-20261003.js 配套；移除两文件即回滚。
 */

/* ------------------------------------------------ ① 自动生成的专题封面 */

/* 原来 11 个专题共用一张站标；现在按 slug 哈希生成稳定色相的渐变封面 */
.qdm-topic-card-media.qdm-topic-card-generated {
  background:
    radial-gradient(125% 125% at 10% 6%,
      hsl(var(--qdm-topic-hue, 275) 62% 27% / .95) 0%,
      transparent 62%),
    linear-gradient(135deg,
      hsl(var(--qdm-topic-hue, 275) 44% 16%) 0%,
      hsl(calc(var(--qdm-topic-hue, 275) + 46) 52% 10%) 100%);
}

.qdm-topic-card-art {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 15px),
    repeating-linear-gradient(24deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 22px);
  pointer-events: none;
}

.qdm-topic-card-initial {
  position: relative;
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, .92);
  letter-spacing: 3px;
  text-shadow: 0 8px 26px rgba(0, 0, 0, .5);
}

.qdm-topic-card-artname {
  position: absolute;
  right: 12px;
  bottom: 9px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, .46);
}

/* 悬停时首字放大一点，卡片有反馈 */
.qdm-topic-card:hover .qdm-topic-card-initial {
  transform: scale(1.06);
}

.qdm-topic-card-initial {
  transition: transform .25s ease;
}

/* ------------------------------------- ② 空的系统分类（待分类游戏）不展示 */

.qdm-topic-hidden {
  display: none !important;
}

/* ------------------------------- ⑥ 详情页补齐：玩家评价 / 补充说明 / 标签 */

.qdm-game-review {
  margin-top: 40px;
}

.qdm-review-card {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel-2) 78%, transparent);
}

.qdm-review-score {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-right: 24px;
  border-right: 1px solid var(--line);
}

.qdm-review-score > strong {
  font-size: 38px;
  line-height: 1;
  font-weight: 900;
  color: color-mix(in srgb, var(--text) 88%, var(--pink));
}

.qdm-review-score > small {
  color: var(--muted);
  font-size: 13px;
}

.qdm-review-score > em {
  margin-left: 10px;
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
  color: color-mix(in srgb, var(--text) 80%, var(--pink));
}

.qdm-review-body {
  flex: 1 1 auto;
  min-width: 0;
}

.qdm-review-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--line) 70%, transparent);
}

.qdm-review-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--pink) 88%, #fff) 0%,
    var(--pink) 100%);
}

.qdm-review-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.qdm-review-line > strong {
  color: var(--text);
}

.qdm-review-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.qdm-game-notes {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-2) 62%, transparent);
}

.qdm-game-notes > h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.qdm-game-notes > p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.qdm-notes-tags {
  margin-top: 10px;
}

/* ------------------- ⑨ 图片展示：大图 + 横排缩略图 + 查看器（对齐参考站） */

/* 大图：2026-10-03 起隐藏 —— 只留一排缩略图，点缩略图直接开查看器放大看 */
.qdm-game-gallery-main {
  display: none !important;
}

/* 缩略图：一排，可横向滚动；滚动条隐藏（干净整洁，不留白滑线条） */
.qdm-game-gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 0;
  padding-bottom: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.qdm-game-gallery-thumbs::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.qdm-game-gallery-thumbs > button {
  flex: 0 0 156px;
  width: 156px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-2);
  cursor: pointer;
  opacity: .62;
  scroll-snap-align: start;
  transition: opacity .2s, border-color .2s, transform .2s;
}

.qdm-game-gallery-thumbs > button:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.qdm-game-gallery-thumbs > button[aria-selected="true"] {
  border-color: var(--pink);
  opacity: 1;
}

.qdm-game-gallery-thumbs > button > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
}

/* 查看器（图二：大图 + 左右箭头 + 底部页码 + 右上角关闭） */
.qdm-gallery-viewer {
  width: min(1180px, 94vw);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.qdm-gallery-viewer::backdrop {
  background: rgba(4, 5, 8, .9);
  backdrop-filter: blur(3px);
}

.qdm-gallery-viewer .qdm-gv-image {
  width: 100%;
  max-height: 82vh;
  display: block;
  object-fit: contain;
  border-radius: 10px;
  background: #06070a;
}

.qdm-gv-close,
.qdm-gv-prev,
.qdm-gv-next {
  position: fixed;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(20, 21, 26, .72);
  color: #fff;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}

.qdm-gv-close:hover,
.qdm-gv-prev:hover,
.qdm-gv-next:hover {
  background: rgba(40, 42, 50, .92);
  border-color: rgba(255, 255, 255, .38);
}

.qdm-gv-close {
  top: 22px;
  right: 26px;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
}

.qdm-gv-prev,
.qdm-gv-next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 28px;
  line-height: 1;
}

.qdm-gv-prev { left: 22px; }
.qdm-gv-next { right: 22px; }

.qdm-gv-prev:hover { transform: translateY(-50%) translateX(-2px); }
.qdm-gv-next:hover { transform: translateY(-50%) translateX(2px); }

.qdm-gv-count {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(20, 21, 26, .72);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 13px;
  letter-spacing: 1px;
}

html.qdm-viewer-open {
  overflow: hidden;
}

/* 移动端：缩略图更小一点 */
@media (max-width: 900px) {
  .qdm-game-gallery-thumbs > button {
    flex: 0 0 116px;
    width: 116px;
  }
}

/* ---------- ⑩ 详情页「干净版式」：整页背景大图 + 居中窄栏 + 小封面 ---------- */

/* 整页背景（游戏截图铺满 + 暗色遮罩），内容浮在上层 */
.qdm-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  filter: blur(7px) saturate(.85);
  transform: scale(1.06);
  opacity: .30;
  pointer-events: none;
}

.qdm-detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(8, 9, 13, .35), rgba(8, 9, 13, .92) 70%),
    linear-gradient(180deg, rgba(8, 9, 13, .72) 0%, rgba(8, 9, 13, .94) 55%, rgba(6, 7, 10, .98) 100%);
}

html.qdm-detail-clean #root {
  position: relative;
  z-index: 1;
}

/* 居中窄栏 */
html.qdm-detail-clean .qdm-library-detail,
html.qdm-detail-clean .qdm-game-returnbar {
  width: min(960px, calc(100vw - 40px));
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

/* hero：小封面 + 紧凑标题 */
html.qdm-detail-clean .qdm-game-hero {
  width: 100%;
  min-height: 0;
  left: auto;
  transform: none;
  padding: 22px 0 10px;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

html.qdm-detail-clean .qdm-game-hero-copy {
  transform: none;
}

html.qdm-detail-clean .qdm-game-poster {
  width: 168px;
  border-radius: 10px;
}

html.qdm-detail-clean .qdm-game-hero h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -.6px;
}

html.qdm-detail-clean .qdm-game-title-en {
  margin: 0 0 12px;
  font-size: 14px;
  letter-spacing: .3px;
}

html.qdm-detail-clean .qdm-game-meta-line {
  margin: 0 0 12px;
  font-size: 13px;
  gap: 7px 14px;
}

html.qdm-detail-clean .qdm-game-hero-tags {
  gap: 7px;
}

html.qdm-detail-clean .qdm-game-hero-tags span {
  padding: 5px 11px;
  font-size: 11px;
}

/* 「补充说明」隐藏后，版本说明并以小字附在「游戏介绍」末尾 */
html.qdm-detail-clean .qdm-game-intro .qdm-intro-extra {
  margin: 16px 0 0;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
  letter-spacing: .2px;
}

/* 正文行宽收窄一点，长句更好读 */
html.qdm-detail-clean .qdm-game-intro p:not(.qdm-intro-extra) {
  max-width: 46em;
}

/* 删掉「游戏资料」与「补充说明」两块 */
html.qdm-detail-clean .qdm-game-profile,
html.qdm-detail-clean .qdm-game-notes {
  display: none !important;
}

/* 正文两栏 + 整体收紧留白 */
html.qdm-detail-clean .qdm-game-showcase {
  margin-top: 26px;
  grid-template-columns: minmax(0, 2fr) minmax(292px, 1fr);
  gap: 26px;
}

html.qdm-detail-clean .qdm-game-intro {
  min-height: 0;
  padding: 20px 22px;
}

html.qdm-detail-clean .qdm-game-intro h2 {
  margin-bottom: 12px;
  font-size: 17px;
}

html.qdm-detail-clean .qdm-game-intro p {
  font-size: 13.5px;
  line-height: 1.95;
}

html.qdm-detail-clean .qdm-game-resource {
  margin-top: 18px;
}

html.qdm-detail-clean .qdm-game-resource-heading h2 {
  font-size: 17px;
}

html.qdm-detail-clean .qdm-game-section-heading h2 {
  font-size: 19px;
}

html.qdm-detail-clean .qdm-game-section-heading > div > span {
  height: 20px;
}

html.qdm-detail-clean .qdm-game-review,
html.qdm-detail-clean .qdm-game-faq,
html.qdm-detail-clean .qdm-game-related {
  margin-top: 30px;
}

html.qdm-detail-clean .qdm-review-card {
  padding: 16px 18px;
}

html.qdm-detail-clean .qdm-game-returnbar {
  margin-top: 10px;
}

/* 窄屏：单栏 */
@media (max-width: 900px) {
  html.qdm-detail-clean .qdm-game-hero {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
  }

  html.qdm-detail-clean .qdm-game-poster {
    width: 112px;
  }

  html.qdm-detail-clean .qdm-game-hero h1 {
    font-size: 22px;
  }

  html.qdm-detail-clean .qdm-game-showcase {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* -------------------------------------------------------- 窄屏微调 */

@media (max-width: 900px) {
  .qdm-topic-card-initial {
    font-size: 34px;
  }

  .qdm-topic-card-artname {
    display: none;
  }

  .qdm-review-card {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .qdm-review-score {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 12px;
  }
}

/* ---------- ⑪ 下载地址：免积分获取（地址只在弹窗里出现，不摊在页面上） ---------- */

.qdm-game-download-tile.is-ready {
  cursor: pointer;
  opacity: 1;
  border-color: color-mix(in srgb, var(--pink) 40%, var(--line));
}

.qdm-game-download-tile.is-ready:hover {
  border-color: var(--pink);
  transform: translateY(-1px);
}

