/*!
 * Tagsmod 3.4.1 — ZBUI skin + layout (depends on assets/zbui.min.css)
 *
 * All catalog/detail UI lives under a `.zbui` wrapper and is built from the ZBUI
 * token system (--zb-*): colors, spacing, radii, type, motion all resolve to tokens.
 * Component looks (.tagsmod-btn / -field / -chip / -card / -seg) follow the ZBUI
 * recipes (primary CTA / pill action / input / soft status).
 *
 * Comments are rendered by the active theme via comments_template() and ship their
 * own styles (ripro-x modern comments bring their own `.zbui` scope). This file only
 * provides outer spacing for the region.
 */

/* ============================================================
 * Shared helpers
 * ========================================================== */
.tagsmod-wrap { max-width: 1200px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* Credit links in the game page's maker table. */
.tagsmod-entity-links a { color: var(--zb-link); text-decoration: none; }
.tagsmod-entity-links a:hover { text-decoration: underline; }
.tagsmod-ico { width: var(--zb-icon-lg); height: var(--zb-icon-lg); flex-shrink: 0; }
.tagsmod-ico--sm { width: var(--zb-icon-md); height: var(--zb-icon-md); }
.tagsmod-muted { color: var(--zb-text-muted); font-size: var(--zb-text-sm); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---- Buttons（ZBUI 主 CTA 配方） ---- */
.tagsmod-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--zb-space-xs);
  min-height: var(--zb-control-h-sm);
  padding: 0 var(--zb-space-md);
  border: 1px solid transparent;
  border-radius: var(--zb-radius-sm);
  font-size: var(--zb-text-base);
  font-weight: var(--zb-weight-medium);
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--zb-duration-base) var(--zb-ease),
    border-color var(--zb-duration-base) var(--zb-ease),
    color var(--zb-duration-base) var(--zb-ease),
    transform var(--zb-duration-fast) var(--zb-ease);
}
.tagsmod-btn:active { transform: translateY(1px); }
.tagsmod-btn:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-btn--lg { min-height: var(--zb-control-h); padding: 0 var(--zb-space-lg); }
.tagsmod-btn--primary { background: var(--zb-primary); color: var(--zb-on-primary); box-shadow: var(--zb-shadow-action); }
.tagsmod-btn--primary:hover { background: var(--zb-primary-hover); color: var(--zb-on-primary); }
.tagsmod-btn--secondary { background: var(--zb-surface); color: var(--zb-text); border-color: var(--zb-border); }
.tagsmod-btn--secondary:hover { background: var(--zb-muted); color: var(--zb-text); }

/* ---- Fields（ZBUI 输入配方） ---- */
.tagsmod-field {
  width: 100%;
  min-height: var(--zb-control-h-sm);
  padding: 0 var(--zb-space-sm);
  border: 1px solid var(--zb-field-border);
  border-radius: var(--zb-radius-sm);
  background: var(--zb-field);
  color: var(--zb-text);
  font-size: var(--zb-text-base);
  box-shadow: var(--zb-field-shadow);
  outline: 0;
  transition: border-color var(--zb-duration-base) var(--zb-ease), box-shadow var(--zb-duration-base) var(--zb-ease);
}
.tagsmod-field::placeholder { color: var(--zb-text-subtle); }
.tagsmod-field:focus { border-color: var(--zb-primary); box-shadow: var(--zb-focus-ring); }

/* ---- Segmented control（目录排序 / 介绍语言共用） ---- */
.tagsmod-seg {
  display: inline-flex;
  align-items: center;
  gap: var(--zb-space-2xs);
  max-width: 100%;
  padding: var(--zb-space-2xs);
  border: 1px solid var(--zb-chip-border);
  border-radius: var(--zb-radius-pill);
  background: var(--zb-muted);
  /* 作为内部读屏文字的定位祖先，让它随滚动区裁剪，否则会撑宽整页、拉宽手机的固定底栏 */
  position: relative;
  overflow-x: auto;
}
.tagsmod-seg-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--zb-control-h-xs);
  padding: 0 var(--zb-space-sm);
  border-radius: var(--zb-radius-pill);
  font-size: var(--zb-text-sm);
  font-weight: var(--zb-weight-medium);
  line-height: 1;
  color: var(--zb-text-soft);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--zb-duration-base) var(--zb-ease),
    color var(--zb-duration-base) var(--zb-ease),
    box-shadow var(--zb-duration-base) var(--zb-ease);
}
.tagsmod-seg-item:hover { color: var(--zb-text); }
.tagsmod-seg-item:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-seg-item.is-active {
  background: var(--zb-primary);
  color: var(--zb-on-primary);
  box-shadow: var(--zb-shadow-action);
}

/* ---- Chips / pills（ZBUI 胶囊配方） ---- */
.tagsmod-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--zb-space-2xs);
  min-height: 30px;
  padding: 0 var(--zb-space-sm);
  border: 1px solid var(--zb-chip-border);
  border-radius: var(--zb-radius-pill);
  background: var(--zb-muted);
  color: var(--zb-text-soft);
  font-size: var(--zb-text-xs);
  font-weight: var(--zb-weight-medium);
  line-height: 1;
  transition: border-color var(--zb-duration-base) var(--zb-ease),
    background-color var(--zb-duration-base) var(--zb-ease),
    color var(--zb-duration-base) var(--zb-ease),
    transform var(--zb-duration-fast) var(--zb-ease);
}
.tagsmod-chip--sm { min-height: var(--zb-control-h-xs); }
.tagsmod-chip--info {
  background: var(--zb-primary-soft);
  border-color: var(--zb-primary-soft-border);
  color: var(--zb-primary-soft-text);
}
.tagsmod-chip--muted { color: var(--zb-text-subtle); }
a.tagsmod-chip, .tagsmod-chip--button { cursor: pointer; }
a.tagsmod-chip:hover, .tagsmod-chip--button:hover { border-color: var(--zb-primary-soft-border-strong); transform: translateY(-1px); }
a.tagsmod-chip:active, .tagsmod-chip--button:active { transform: translateY(0); }
a.tagsmod-chip:focus-visible, .tagsmod-chip--button:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 var(--zb-space-2xs);
  border-radius: var(--zb-radius-pill);
  background: var(--zb-surface);
  font-size: var(--zb-text-xs);
}

/* ---- Cards / sections ---- */
.tagsmod-card {
  border: 1px solid var(--zb-border);
  border-radius: var(--zb-radius-lg);
  background: var(--zb-surface);
  box-shadow: var(--zb-shadow-card), var(--zb-inset-highlight);
  color: var(--zb-text);
}
.tagsmod-section { padding: var(--zb-space-lg); }
.tagsmod-card-title {
  display: flex;
  align-items: center;
  gap: var(--zb-space-xs);
  margin-bottom: var(--zb-space-sm);
  font-size: var(--zb-text-lg);
  font-weight: var(--zb-weight-semibold);
  color: var(--zb-text);
}
.tagsmod-card-title--bare { margin-bottom: 0; }
.tagsmod-title-ico { color: var(--zb-text-muted); }
.tagsmod-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zb-space-sm);
  margin-bottom: var(--zb-space-sm);
}
.tagsmod-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--zb-space-xs);
  border: 1px solid var(--zb-chip-border);
  border-radius: var(--zb-radius-pill);
  background: var(--zb-muted);
  color: var(--zb-text-muted);
  font-size: var(--zb-text-xs);
  font-weight: var(--zb-weight-medium);
}

/* ---- Empty / error states ---- */
.tagsmod-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--zb-space-xs);
  margin: var(--zb-space-xl) 0;
  padding: var(--zb-space-2xl) var(--zb-space-lg);
  border: 1px dashed var(--zb-border);
  border-radius: var(--zb-radius-lg);
  background: var(--zb-surface);
  text-align: center;
}
.tagsmod-empty-ico { width: 40px; height: 40px; color: var(--zb-text-subtle); }
.tagsmod-empty-title { font-size: var(--zb-text-md); font-weight: var(--zb-weight-semibold); color: var(--zb-text); }
.tagsmod-empty-hint { font-size: var(--zb-text-sm); color: var(--zb-text-muted); }
.tagsmod-empty-state .tagsmod-btn { margin-top: var(--zb-space-xs); }
.tagsmod-empty-note { color: var(--zb-text-muted); font-size: var(--zb-text-sm); }

/* ============================================================
 * Catalog landing - cinematic gallery
 * ========================================================== */
html.tagsmod-landing-active,
html.tagsmod-landing-active body { overflow: hidden !important; }
body.tagsmod-landing-open { overscroll-behavior: none; }

.tagsmod-landing {
  --tagsmod-wall-gap: 12px;
  --pick-safe-bottom: env(safe-area-inset-bottom, 0px);
  --pick-background-opacity: .24;
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100100;
  overflow: hidden;
  isolation: isolate;
  color: var(--zb-text);
  background: var(--zb-surface);
}
html.tagsmod-landing-active .tagsmod-landing { display: block; }
.tagsmod-landing[hidden] { display: none !important; }
.tagsmod-landing:focus { outline: none; }
[data-bs-theme="dark"] .tagsmod-landing { --pick-background-opacity: .18; }
body.admin-bar .tagsmod-landing { top: 32px; }
.tagsmod-landing-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.tagsmod-landing-scene canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; background: var(--zb-surface); }
.tagsmod-landing-fallback {
  position: absolute;
  inset: 0;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  pointer-events: none;
}
.tagsmod-landing-tile {
  position: absolute;
  left: 50%;
  top: 50%;
  overflow: hidden;
  border-radius: 8px;
  background: var(--zb-muted, #e9edf2);
  box-shadow: inset 0 0 0 1px var(--zb-border, #dfe3e8);
  backface-visibility: hidden;
  will-change: transform, opacity;
}
.tagsmod-landing-tile img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.tagsmod-landing.is-picking .tagsmod-landing-scroll { overflow: hidden; touch-action: none; }
.tagsmod-landing.is-picking .tagsmod-landing-copy { pointer-events: none; will-change: opacity; }
.tagsmod-landing.is-picking .tagsmod-landing-track { animation-play-state: paused; }
.tagsmod-landing.is-picking .tagsmod-landing-skip { width: auto; padding: 0 14px; border-radius: var(--zb-radius-pill); }
.tagsmod-landing.is-picking .tagsmod-landing-skip > span { display: inline; }
.tagsmod-landing-result {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  letter-spacing: 0;
}
.tagsmod-landing-result[hidden] { display: none; }
.tagsmod-landing [data-tagsmod-pick-status] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.tagsmod-landing-result-cover {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 8px;
}
.tagsmod-landing-result-cover::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 1px solid var(--zb-primary);
  border-radius: 8px;
  opacity: var(--pick-outline-opacity, .35);
}
.tagsmod-landing-result-cover > span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 8px;
  background: var(--zb-muted);
  color: var(--zb-text-soft);
  font-size: 18px;
  line-height: 1.5;
  text-align: center;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.tagsmod-landing-result-caption { position: absolute; transform: translateX(-50%); text-align: center; }
.tagsmod-landing-result-caption p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--zb-text-muted);
  font-size: 13px;
  line-height: 20px;
}
.tagsmod-landing-result-caption p .tagsmod-ico { color: var(--zb-success); }
.tagsmod-landing-result-caption h2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--zb-text);
  font-size: 24px;
  font-weight: var(--zb-weight-semibold);
  line-height: 1.35;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 767.98px) {
  .tagsmod-landing-result-caption h2 { font-size: 20px; }
}
.tagsmod-landing-scroll {
  position: absolute;
  z-index: 2;
  inset: calc(72px + env(safe-area-inset-top)) 0 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.tagsmod-landing-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
  align-items: center;
  gap: 40px;
  width: min(100%, 1680px);
  min-height: 100%;
  margin: 0 auto;
  padding: 16px max(40px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(40px, env(safe-area-inset-left));
}
.tagsmod-landing-copy {
  position: relative;
  z-index: 3;
  max-width: 590px;
  width: 100%;
}
html.tagsmod-landing-pending .tagsmod-landing-copy,
html.tagsmod-landing-pending .tagsmod-landing-wall,
.tagsmod-landing[data-intro-state="preparing"] .tagsmod-landing-wall,
.tagsmod-landing.has-gallery .tagsmod-landing-wall,
.tagsmod-landing.has-scene .tagsmod-landing-wall { visibility: hidden; }
.tagsmod-landing[data-intro-state="playing"] .tagsmod-landing-action { transition: none; }
.tagsmod-landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--zb-space-xs);
  min-height: 34px;
  padding: 0 var(--zb-space-sm);
  border: 1px solid var(--zb-primary-soft-border);
  border-radius: var(--zb-radius-pill);
  background: var(--zb-surface-frosted);
  color: var(--zb-primary-soft-text);
  box-shadow: var(--zb-inset-highlight-faint);
  font-size: var(--zb-text-xs);
  font-weight: var(--zb-weight-semibold);
  letter-spacing: 0;
}
.tagsmod-landing-eyebrow-icon { width: var(--zb-icon-md); height: var(--zb-icon-md); }
.tagsmod-landing-title {
  max-width: 100%;
  margin: clamp(22px, 3vh, 36px) 0 0;
  color: var(--zb-text);
  font-size: 96px;
  font-weight: var(--zb-weight-bold);
  line-height: 1;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.tagsmod-landing-title > span { display: block; }
.tagsmod-landing-title-accent {
  width: max-content;
  max-width: 100%;
  padding-right: .08em;
  color: var(--zb-primary);
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  @media (forced-colors: none) {
    .tagsmod-landing-title-accent {
      background: linear-gradient(125deg, var(--zb-primary) 12%, var(--zb-info) 94%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
      filter: drop-shadow(0 12px 28px var(--zb-primary-soft-border));
    }
  }
}
.tagsmod-landing-title:focus { outline: none; }
.tagsmod-landing-description {
  max-width: 520px;
  margin: clamp(22px, 3.2vh, 38px) 0 0;
  color: var(--zb-text-soft);
  font-size: 20px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.tagsmod-landing-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zb-space-sm);
  margin-top: clamp(18px, 2.6vh, 30px);
}
.tagsmod-landing-fact {
  display: inline-flex;
  align-items: center;
  gap: var(--zb-space-2xs);
  min-height: 30px;
  padding: 0 var(--zb-space-sm);
  border: 1px solid var(--zb-chip-border);
  border-radius: var(--zb-radius-pill);
  background: var(--zb-surface-frosted);
  color: var(--zb-text-muted);
  font-size: var(--zb-text-xs);
  box-shadow: var(--zb-inset-highlight-faint);
  font-variant-numeric: tabular-nums;
}
.tagsmod-landing-fact strong { color: var(--zb-text); font-size: var(--zb-text-sm); }
.tagsmod-landing-fact--live i {
  width: 7px;
  height: 7px;
  border-radius: var(--zb-radius-circle);
  background: var(--zb-success);
  box-shadow: 0 0 0 4px var(--zb-success-soft);
}
.tagsmod-landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zb-space-sm);
  margin-top: clamp(26px, 4vh, 44px);
}
.tagsmod-landing-action {
  min-height: 56px;
  max-width: 100%;
  padding: 0 clamp(20px, 2vw, 30px);
  border-radius: var(--zb-radius-pill);
  gap: var(--zb-space-xs);
  font-weight: var(--zb-weight-semibold);
  box-shadow: var(--zb-shadow-action);
}
.tagsmod-landing-action > span { overflow-wrap: anywhere; }
.tagsmod-landing-action .tagsmod-ico { width: var(--zb-icon-md); height: var(--zb-icon-md); }
.tagsmod-landing-action--primary:hover { transform: translateY(-2px); }
.tagsmod-landing-action--primary:active { transform: translateY(0); }
.tagsmod-landing-action--secondary {
  border-color: var(--zb-primary-soft-border);
  background: var(--zb-surface-frosted);
  color: var(--zb-text);
  box-shadow: var(--zb-shadow-card), var(--zb-inset-highlight);
  backdrop-filter: blur(14px);
}
.tagsmod-landing-action--secondary:hover {
  border-color: var(--zb-primary-soft-border-strong);
  background: var(--zb-primary-soft);
  color: var(--zb-primary-soft-text);
  transform: translateY(-2px);
}
.tagsmod-landing-action--secondary:active { transform: translateY(0); }
.tagsmod-landing-browse {
  display: inline-flex;
  align-items: center;
  gap: var(--zb-space-xs);
  min-height: 44px;
  max-width: 100%;
  margin-top: 12px;
  border-radius: var(--zb-radius-xs);
  color: var(--zb-text-soft);
  font-size: var(--zb-text-sm);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color var(--zb-duration-fast) var(--zb-ease);
}
.tagsmod-landing-browse:hover { color: var(--zb-primary); }
.tagsmod-landing-browse:hover > span { text-decoration: underline; }
.tagsmod-landing-browse:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-landing-skip {
  position: absolute;
  z-index: 6;
  top: max(16px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--zb-space-xs);
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--zb-space-sm);
  border: 1px solid var(--zb-chip-border);
  border-radius: var(--zb-radius-pill);
  background: var(--zb-surface-frosted);
  color: var(--zb-text-muted);
  font-size: var(--zb-text-xs);
  font-weight: var(--zb-weight-medium);
  box-shadow: var(--zb-shadow-card), var(--zb-inset-highlight-faint);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: color var(--zb-duration-base) var(--zb-ease), border-color var(--zb-duration-base) var(--zb-ease), transform var(--zb-duration-fast) var(--zb-ease);
}
.tagsmod-landing-skip:hover { color: var(--zb-text); border-color: var(--zb-primary-soft-border-strong); transform: translateY(-1px); }
.tagsmod-landing-skip:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }

.tagsmod-landing-wall {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 440px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 9%, #000 91%, transparent 100%);
}
.tagsmod-landing-columns {
  position: absolute;
  inset: -7% 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--tagsmod-wall-gap);
  align-items: start;
  width: 100%;
  padding: 0 8px;
}
.tagsmod-landing-column { min-width: 0; }
.tagsmod-landing-column--2 { margin-top: -8%; }
.tagsmod-landing-column--3 { margin-top: 5%; }
.tagsmod-landing-column--4 { margin-top: -12%; }
.tagsmod-landing-column--5 { margin-top: 3%; }
.tagsmod-landing-track {
  display: flex;
  flex-direction: column;
  animation: tagsmod-landing-wall-scroll 22s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}
html.tagsmod-landing-active .tagsmod-landing:not(.has-gallery):not(.is-leaving) .tagsmod-landing-track { animation-play-state: running; }
.tagsmod-landing-column--2 .tagsmod-landing-track { animation-duration: 27s; animation-direction: reverse; }
.tagsmod-landing-column--3 .tagsmod-landing-track { animation-duration: 24s; }
.tagsmod-landing-column--4 .tagsmod-landing-track { animation-duration: 29s; animation-direction: reverse; }
.tagsmod-landing-column--5 .tagsmod-landing-track { animation-duration: 25s; }
@keyframes tagsmod-landing-wall-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -50%, 0); }
}
.tagsmod-landing-cover-set {
  display: flex;
  flex-direction: column;
  gap: var(--tagsmod-wall-gap);
  padding-bottom: var(--tagsmod-wall-gap);
}
.tagsmod-landing-cover {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--zb-border);
  border-radius: 8px;
  background: var(--zb-surface-raised);
  box-shadow: var(--zb-shadow-card);
}
.tagsmod-landing-cover--portrait { aspect-ratio: 3 / 4; }
.tagsmod-landing-cover--square { aspect-ratio: 1 / 1; }
.tagsmod-landing-cover--landscape { aspect-ratio: 4 / 3; }
.tagsmod-landing-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tagsmod-landing-cover.is-broken { display: none; }
.tagsmod-landing.is-leaving { animation: tagsmod-landing-out .22s var(--zb-ease-in) both; }
@keyframes tagsmod-landing-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 卡片网格 */
.tagsmod-grid-cards {
  display: grid;
  gap: var(--zb-space-lg);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.tagsmod-game-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--zb-duration-base) var(--zb-ease), transform var(--zb-duration-base) var(--zb-ease);
}
.tagsmod-game-card:hover { box-shadow: var(--zb-shadow-card-hover), var(--zb-inset-highlight); transform: translateY(-4px); }
.tagsmod-game-thumb {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--zb-surface-sunken);
  overflow: hidden;
}
.tagsmod-game-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--zb-duration-slow) var(--zb-ease); }
.tagsmod-game-card:hover .tagsmod-game-thumb img { transform: scale(1.04); }
.tagsmod-game-thumb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--zb-space-2xs);
  width: 100%;
  height: 100%;
  color: var(--zb-text-subtle);
  font-size: var(--zb-text-sm);
  font-weight: var(--zb-weight-medium);
}
.tagsmod-game-thumb-empty .tagsmod-empty-ico { width: 32px; height: 32px; }
.tagsmod-game-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--zb-space-xs);
  padding: var(--zb-space-md);
}
.tagsmod-game-name {
  font-size: var(--zb-text-lg);
  font-weight: var(--zb-weight-semibold);
  line-height: 1.5;
  min-height: 3em;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.tagsmod-game-link { color: var(--zb-text); transition: color var(--zb-duration-base) var(--zb-ease); }
.tagsmod-game-link:hover { color: var(--zb-primary); }
.tagsmod-game-link:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); border-radius: var(--zb-radius-xs); }

/* 入场 stagger（签名细节；尊重减动效） */
@media (prefers-reduced-motion: no-preference) {
  .tagsmod-grid-cards .tagsmod-game-card {
    animation: tagsmod-card-in var(--zb-duration-slow) var(--zb-ease-out) backwards;
  }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(2) { animation-delay: 20ms; }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(3) { animation-delay: 40ms; }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(4) { animation-delay: 60ms; }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(5) { animation-delay: 80ms; }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(6) { animation-delay: 100ms; }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(7) { animation-delay: 120ms; }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(8) { animation-delay: 120ms; }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(9) { animation-delay: 120ms; }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(10) { animation-delay: 120ms; }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(11) { animation-delay: 120ms; }
  .tagsmod-grid-cards .tagsmod-game-card:nth-child(12) { animation-delay: 120ms; }
}
@keyframes tagsmod-card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* 分页 */
.tagsmod-pagination { width: 100%; }
.tagsmod-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zb-space-xs);
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tagsmod-pagination li { display: flex; }
.tagsmod-pagination a.page-numbers,
.tagsmod-pagination span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--zb-space-sm);
  border-radius: var(--zb-radius-pill);
  border: 1px solid var(--zb-border);
  background: var(--zb-surface);
  color: var(--zb-text-soft);
  font-weight: var(--zb-weight-medium);
  font-size: var(--zb-text-sm);
  text-decoration: none;
  transition: border-color var(--zb-duration-base) var(--zb-ease),
    color var(--zb-duration-base) var(--zb-ease),
    background-color var(--zb-duration-base) var(--zb-ease);
}
.tagsmod-pagination a.page-numbers:hover { border-color: var(--zb-primary); color: var(--zb-primary); }
.tagsmod-pagination a.page-numbers:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-pagination span.page-numbers.current { background: var(--zb-primary); border-color: transparent; color: var(--zb-on-primary); }
.tagsmod-pagination span.page-numbers.dots { border-color: transparent; background: transparent; color: var(--zb-text-subtle); }

/* ============================================================
 * Detail (single game)
 * ========================================================== */
.tagsmod-single { color: var(--zb-text); background: var(--zb-surface-sunken); }
/* Standard scrollbar colors also apply when scrollbar-width overrides WebKit styling. */
.tagsmod-single {
  color-scheme: light;
  scrollbar-color: var(--zb-text-muted) var(--zb-surface-sunken);
}
[data-bs-theme="dark"] .tagsmod-single { color-scheme: dark; }
@supports not (scrollbar-color: auto) {
  .tagsmod-single ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    background: var(--zb-surface-sunken);
  }
  .tagsmod-single ::-webkit-scrollbar-track,
  .tagsmod-single ::-webkit-scrollbar-corner { background: var(--zb-surface-sunken); }
  .tagsmod-single ::-webkit-scrollbar-thumb {
    background: var(--zb-text-muted);
    border: 2px solid var(--zb-surface-sunken);
    border-radius: var(--zb-radius-pill);
  }
  .tagsmod-single ::-webkit-scrollbar-thumb:hover { background: var(--zb-text-soft); }
}
.tagsmod-hero {
  position: relative;
  overflow: hidden;
  padding: var(--zb-space-xl) 0;
  background: var(--zb-surface);
  border-bottom: 1px solid var(--zb-border);
}
/* 签名细节：封面环境光 —— 模糊封面渐隐入面板面，明暗两态零新增色 */
.tagsmod-hero-backdrop {
  position: absolute;
  inset: -48px;
  background-size: cover;
  background-position: center 30%;
  filter: blur(32px) saturate(1.1);
  opacity: .16;
  pointer-events: none;
}
[data-bs-theme="dark"] .tagsmod-hero-backdrop { opacity: .22; }
.tagsmod-hero--ambient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, var(--zb-surface) 96%);
  pointer-events: none;
}
.tagsmod-hero-inner { position: relative; }

.tagsmod-breadcrumb {
  margin-bottom: var(--zb-space-sm);
  font-size: var(--zb-text-sm);
  line-height: 20px;
  color: var(--zb-text-muted);
  min-width: 0;
}
.tagsmod-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tagsmod-breadcrumb-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.tagsmod-breadcrumb a {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 44px;
  white-space: nowrap;
  color: var(--zb-text-muted);
  text-decoration: none;
  border-radius: var(--zb-radius-xs);
  transition: color var(--zb-duration-base) var(--zb-ease);
}
.tagsmod-breadcrumb a:hover { color: var(--zb-primary); }
.tagsmod-breadcrumb a:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-breadcrumb-sep { display: inline-flex; align-items: center; flex: none; height: 44px; color: var(--zb-text-subtle); }
.tagsmod-breadcrumb .tagsmod-breadcrumb-sep .tagsmod-ico { width: 12px; height: 12px; }
.tagsmod-breadcrumb-current {
  min-width: 0;
  padding-block: 12px;
  color: var(--zb-text-soft);
  overflow-wrap: anywhere;
}

.tagsmod-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: var(--zb-weight-bold);
  line-height: var(--zb-leading-tight);
  color: var(--zb-text);
}
.tagsmod-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zb-space-xs) var(--zb-space-sm);
  margin-top: var(--zb-space-sm);
}
.tagsmod-meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--zb-space-2xs);
  font-size: var(--zb-text-sm);
  color: var(--zb-text-soft);
}
.tagsmod-meta-item .tagsmod-ico { width: var(--zb-icon-md); height: var(--zb-icon-md); color: var(--zb-text-muted); }
.tagsmod-meta-label { color: var(--zb-text-muted); }

.tagsmod-single-body { padding-top: var(--zb-space-xl); padding-bottom: var(--zb-space-2xl); }
.tagsmod-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  /* 行 2 用 1fr 吸收右栏（跨两行）的多余高度，保证相关文章紧贴左栏内容 */
  grid-template-rows: auto 1fr;
  gap: var(--zb-space-xl);
  align-items: start;
}
/* 封面 + 图集 */
.tagsmod-cover-link {
  display: block;
  border-radius: var(--zb-radius-lg);
  overflow: hidden;
  box-shadow: var(--zb-shadow-card);
  cursor: zoom-in;
}
.tagsmod-cover-img { display: block; width: 100%; height: auto; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tagsmod-cover-link { transition: transform var(--zb-duration-base) var(--zb-ease), box-shadow var(--zb-duration-base) var(--zb-ease); }
  .tagsmod-cover-link:hover { transform: translateY(-2px); box-shadow: var(--zb-shadow-card-hover); }
}
.tagsmod-cover-empty {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--zb-space-2xs);
  border-radius: var(--zb-radius-lg);
  background: var(--zb-surface);
  color: var(--zb-text-subtle);
  font-size: var(--zb-text-sm);
}
.tagsmod-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--zb-space-xs);
  margin-top: var(--zb-space-sm);
}
.tagsmod-gallery-item {
  position: relative;
  display: block;
  border-radius: var(--zb-radius-sm);
  overflow: hidden;
  cursor: zoom-in;
}
.tagsmod-gallery-item:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform var(--zb-duration-base) var(--zb-ease);
}
.tagsmod-gallery-item:hover img { transform: scale(1.05); }
.tagsmod-gallery-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--zb-overlay);
  color: var(--zb-on-solid);
  font-size: var(--zb-text-lg);
  font-weight: var(--zb-weight-semibold);
}

/* 资料表 */
.tagsmod-table { width: 100%; border-collapse: collapse; font-size: var(--zb-text-sm); }
.tagsmod-table th, .tagsmod-table td {
  border-bottom: 1px solid var(--zb-border);
  padding: var(--zb-space-sm) var(--zb-space-xs);
  vertical-align: top;
  text-align: left;
  color: var(--zb-text);
  line-height: var(--zb-leading-normal);
}
.tagsmod-table tr:last-child th, .tagsmod-table tr:last-child td { border-bottom: 0; }
.tagsmod-table th { width: 30%; font-weight: var(--zb-weight-semibold); color: var(--zb-text-soft); }
.tagsmod-dl th { vertical-align: middle; }
.tagsmod-dl-badges,
.tagsmod-taxonomy-badges { display: flex; flex-wrap: wrap; gap: var(--zb-space-xs); }

/* 介绍（.tagsmod-seg 复用为语言切换） */
.tagsmod-prose { color: var(--zb-text-soft); font-size: var(--zb-text-base); line-height: var(--zb-leading-normal); }
.tagsmod-prose :where(p) { margin: 0 0 var(--zb-space-sm); }
.tagsmod-prose :where(p):last-child { margin-bottom: 0; }
.tagsmod-prose :where(a) { color: var(--zb-link); text-decoration: underline; }
.tagsmod-prose :where(img) { border-radius: var(--zb-radius-sm); margin: var(--zb-space-sm) 0; }
.tagsmod-prose :where(h1, h2, h3, h4) {
  margin: var(--zb-space-md) 0 var(--zb-space-xs);
  font-size: var(--zb-text-md);
  font-weight: var(--zb-weight-semibold);
  color: var(--zb-text);
}

/* 相关文章（左栏；「游戏资源」跳转目标） */
.tagsmod-related { scroll-margin-top: 80px; }
.tagsmod-posts { display: grid; grid-template-columns: 1fr; gap: var(--zb-space-2xs); }
.tagsmod-posts a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--zb-space-sm);
  padding: var(--zb-space-xs) var(--zb-space-sm);
  border-radius: var(--zb-radius-sm);
  color: var(--zb-link);
  font-size: var(--zb-text-sm);
  line-height: var(--zb-leading-snug);
  transition: background-color var(--zb-duration-base) var(--zb-ease), color var(--zb-duration-base) var(--zb-ease);
}
.tagsmod-posts a:hover { background: var(--zb-primary-soft); color: var(--zb-primary-soft-text); }
.tagsmod-posts a:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-post-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagsmod-post-date { flex-shrink: 0; color: var(--zb-text-muted); font-size: var(--zb-text-xs); }

/* 「游戏资源」锚点到达时的注意力提示（替代旧 JS 闪烁） */
.tagsmod-related:target { animation: tagsmod-target-flash 1.2s var(--zb-ease) 1; }
@keyframes tagsmod-target-flash {
  0%, 100% { box-shadow: var(--zb-shadow-card), var(--zb-inset-highlight); border-color: var(--zb-border); }
  20%, 60% { box-shadow: 0 0 0 2px var(--zb-primary) inset, var(--zb-shadow-card); border-color: var(--zb-primary); }
  40%, 80% { box-shadow: var(--zb-shadow-card), var(--zb-inset-highlight); border-color: var(--zb-border); }
}

/* 评论区域（内部样式 100% 由主题提供） */
.tagsmod-comments-region { margin-top: var(--zb-space-xl); margin-bottom: var(--zb-space-2xl); }

/* ============================================================
 * Lightbox（JS 懒建；触发器无 JS 时退化为原图链接）
 * ========================================================== */
body.tagsmod-lightbox-open { overflow: hidden; }
.tagsmod-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--zb-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--zb-space-2xl);
}
.tagsmod-lightbox[hidden] { display: none; }
.tagsmod-lightbox-backdrop { position: absolute; inset: 0; background: var(--zb-overlay); cursor: zoom-out; }
.tagsmod-lightbox-stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(1100px, 100%);
  max-height: 100%;
}
.tagsmod-lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 96px);
  border-radius: var(--zb-radius-md);
  background: var(--zb-surface);
  box-shadow: var(--zb-shadow-overlay);
}
@media (prefers-reduced-motion: no-preference) {
  .tagsmod-lightbox-img { animation: tagsmod-lb-in var(--zb-duration-base) var(--zb-ease-out); }
}
@keyframes tagsmod-lb-in {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: none; }
}
.tagsmod-lightbox-btn {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--zb-control-h);
  height: var(--zb-control-h);
  border: 1px solid var(--zb-border);
  border-radius: var(--zb-radius-circle);
  background: var(--zb-surface-frosted);
  color: var(--zb-text);
  cursor: pointer;
  transition: transform var(--zb-duration-fast) var(--zb-ease), box-shadow var(--zb-duration-base) var(--zb-ease);
}
.tagsmod-lightbox-btn:hover { box-shadow: var(--zb-shadow-raise); transform: scale(1.05); }
.tagsmod-lightbox-btn:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-lightbox-btn[disabled] { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.tagsmod-lightbox-close { top: var(--zb-space-lg); right: var(--zb-space-lg); }
.tagsmod-lightbox-prev { left: var(--zb-space-lg); top: 50%; transform: translateY(-50%); }
.tagsmod-lightbox-next { right: var(--zb-space-lg); top: 50%; transform: translateY(-50%); }
.tagsmod-lightbox-prev:hover, .tagsmod-lightbox-next:hover { transform: translateY(-50%) scale(1.05); }
.tagsmod-lightbox-counter {
  position: absolute;
  z-index: 2;
  bottom: var(--zb-space-lg);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--zb-space-2xs) var(--zb-space-sm);
  border-radius: var(--zb-radius-pill);
  background: var(--zb-surface-frosted);
  border: 1px solid var(--zb-border);
  color: var(--zb-text-soft);
  font-size: var(--zb-text-sm);
  box-shadow: var(--zb-shadow-overlay);
}

@media (prefers-reduced-motion: reduce) {
  .tagsmod-landing,
  .tagsmod-landing * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
  .tagsmod-landing-copy,
  .tagsmod-landing-wall,
  .tagsmod-landing-track,
  .tagsmod-landing-ambient,
  .tagsmod-landing-ripple { animation: none !important; }
  .tagsmod-landing-grid-lines { transform: perspective(620px) rotateX(62deg); }
  .tagsmod-landing-column--1,
  .tagsmod-landing-column--2,
  .tagsmod-landing-column--3 { transform: none; }
  .tagsmod-landing-ripple { display: none; }
}

/* ============================================================
 * Responsive
 * ========================================================== */
@media (max-width: 1599.98px) {
  .tagsmod-landing-title { font-size: 80px; }
  .tagsmod-landing-description { font-size: 18px; }
}
@media (max-width: 1199.98px) {
  .tagsmod-landing-title { font-size: 64px; }
  .tagsmod-landing-description { font-size: 16px; }
  .tagsmod-landing-shell { gap: 24px; }
}
@media (max-width: 991.98px) {
  .tagsmod-landing-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(240px, 1fr);
    align-items: start;
    gap: 28px;
    padding: 8px max(32px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(32px, env(safe-area-inset-left));
  }
  .tagsmod-landing-copy {
    justify-self: center;
    max-width: 720px;
    padding-right: 0;
    text-align: center;
  }
  .tagsmod-landing-title {
    margin-top: clamp(16px, 2.4vh, 24px);
    font-size: 80px;
    line-height: .94;
  }
  .tagsmod-landing-title-accent { margin-right: auto; margin-left: auto; }
  .tagsmod-landing-description { margin: clamp(14px, 2vh, 20px) auto 0; }
  .tagsmod-landing-facts,
  .tagsmod-landing-actions { justify-content: center; }
  .tagsmod-landing-facts { margin-top: clamp(13px, 2vh, 20px); }
  .tagsmod-landing-actions { margin-top: clamp(18px, 2.8vh, 28px); }
  .tagsmod-landing-wall {
    width: min(100%, 820px);
    min-height: 240px;
    margin: 0 auto;
  }

  .tagsmod-grid { grid-template-columns: 1fr; }
}
@media (max-width: 782px) {
  body.admin-bar .tagsmod-landing { top: 46px; }
}
@media (max-width: 767.98px) {
  .tagsmod-landing-shell {
    grid-template-rows: auto minmax(200px, 1fr);
    gap: 24px;
    padding: 0 max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }
  .tagsmod-landing-skip { top: max(12px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); }
  .tagsmod-landing-eyebrow { min-height: 30px; font-size: 11px; }
  .tagsmod-landing-title { font-size: 64px; }
  .tagsmod-landing-description {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.62;
  }
  .tagsmod-landing-facts { gap: var(--zb-space-xs); margin-top: 12px; }
  .tagsmod-landing-fact { min-height: 27px; padding: 0 var(--zb-space-xs); }
  .tagsmod-landing-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 390px);
    margin: 16px auto 0;
  }
  .tagsmod-landing-action { min-width: 0; min-height: 50px; padding: 0 13px; font-size: var(--zb-text-sm); }
  .tagsmod-landing-browse { margin-top: 8px; }
  .tagsmod-landing-wall { min-height: 200px; }
  .tagsmod-landing { --tagsmod-wall-gap: 9px; }
  .tagsmod-landing-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); inset: -12% 3% 0; width: auto; }
  .tagsmod-landing-column--4,
  .tagsmod-landing-column--5 { display: none; }
  .tagsmod-landing-column--1 .tagsmod-landing-track { animation-duration: 26s; }
  .tagsmod-landing-column--2 .tagsmod-landing-track { animation-duration: 31s; }
  .tagsmod-landing-column--3 .tagsmod-landing-track { animation-duration: 28s; }

  .tagsmod-lightbox { padding: var(--zb-space-md); }
  .tagsmod-lightbox-img { max-height: calc(100vh - 64px); }
  .tagsmod-lightbox-btn { width: var(--zb-control-h-sm); height: var(--zb-control-h-sm); }
  .tagsmod-lightbox-close { top: var(--zb-space-sm); right: var(--zb-space-sm); }
  .tagsmod-lightbox-prev { left: var(--zb-space-sm); }
  .tagsmod-lightbox-next { right: var(--zb-space-sm); }
}
@media (max-width: 575.98px) {
  .tagsmod-landing-skip > span { display: none; }
  .tagsmod-landing-skip { width: 44px; padding: 0; border-radius: var(--zb-radius-circle); }
  .tagsmod-landing-title { font-size: 54px; }
  .tagsmod-landing-fact { font-size: 11px; }

  .tagsmod-grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--zb-space-sm); }
  .tagsmod-game-meta { padding: var(--zb-space-sm); }
  .tagsmod-game-name { font-size: var(--zb-text-md); }
}
@media (max-height: 720px) and (min-width: 992px) {
  .tagsmod-landing-title { margin-top: 18px; font-size: 64px; }
  .tagsmod-landing-description { margin-top: 18px; font-size: 16px; }
  .tagsmod-landing-facts { margin-top: 14px; }
  .tagsmod-landing-actions { margin-top: 22px; }
}
@media (max-height: 680px) and (max-width: 991.98px) {
  .tagsmod-landing-eyebrow { min-height: 27px; }
  .tagsmod-landing-title { margin-top: 10px; font-size: 54px; }
  .tagsmod-landing-description { margin-top: 8px; line-height: 1.45; }
  .tagsmod-landing-facts { margin-top: 8px; }
  .tagsmod-landing-actions { margin-top: 11px; }
  .tagsmod-landing-action { min-height: 44px; }
}
@media (max-width: 359.98px) {
  .tagsmod-landing-title { font-size: 44px; }
  .tagsmod-landing-actions { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
 * Modern game detail layout
 * ========================================================== */
.tagsmod-detail-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  grid-template-rows: auto auto;
  gap: clamp(var(--zb-space-lg), 3vw, var(--zb-space-2xl));
  align-items: start;
}

.tagsmod-detail-feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: clamp(var(--zb-space-lg), 3vw, var(--zb-space-2xl));
  align-items: stretch;
  min-width: 0;
  padding: 0;
}
.tagsmod-detail-content,
.tagsmod-resource-rail {
  min-width: 0;
}
.tagsmod-detail-content {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: var(--zb-space-lg);
}
.tagsmod-resource-rail {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: var(--zb-space-lg);
  align-self: stretch;
}

.tagsmod-feature-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--zb-space-lg);
  min-width: 0;
}
/* 主图按自身 16:9 定高，不随右栏内容拉伸 */
.tagsmod-detail-feature > .tagsmod-media {
  align-self: start;
  min-width: 0;
}
.tagsmod-related {
  position: sticky;
  top: 24px;
}

.tagsmod-preview-card { padding: var(--zb-space-sm); overflow: hidden; }
.tagsmod-preview-stage-wrap { position: relative; }
.tagsmod-preview-stage {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--zb-radius-md);
  background: var(--zb-surface-sunken);
  cursor: zoom-in;
  /* 横向滑动交给脚本切换截图，竖向仍滚动页面 */
  touch-action: pan-y pinch-zoom;
}
.tagsmod-preview-stage:focus-visible,
.tagsmod-cover-link:focus-visible,
.tagsmod-gallery-item:focus-visible {
  outline: none;
  box-shadow: var(--zb-focus-ring);
}
.tagsmod-preview-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--zb-surface-sunken);
}
/* 合并封面时 <picture> 只负责按断点选首张图，不参与布局 */
.tagsmod-preview-stage > picture { display: contents; }
.tagsmod-preview-counter {
  position: absolute;
  right: var(--zb-space-sm);
  bottom: var(--zb-space-sm);
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--zb-radius-pill);
  background: rgba(10, 15, 24, .72);
  color: #fff;
  font-size: var(--zb-text-xs);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
}
.tagsmod-preview-control {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--zb-radius-circle);
  background: rgba(10, 15, 24, .66);
  color: #fff;
  cursor: pointer;
  opacity: .86;
  transform: translateY(-50%);
  transition: opacity var(--zb-duration-fast) var(--zb-ease), background-color var(--zb-duration-fast) var(--zb-ease), transform var(--zb-duration-fast) var(--zb-ease);
}
.tagsmod-preview-control:hover { opacity: 1; background: rgba(10, 15, 24, .84); transform: translateY(-50%) scale(1.04); }
.tagsmod-preview-control:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-preview-control .tagsmod-ico { width: 20px; height: 20px; }
.tagsmod-preview-control[hidden] { display: none; }
.tagsmod-preview-prev { left: var(--zb-space-sm); }
.tagsmod-preview-next { right: var(--zb-space-sm); }
.tagsmod-preview-empty {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--zb-space-xs);
  border: 1px dashed var(--zb-border);
  border-radius: var(--zb-radius-md);
  background: var(--zb-surface-sunken);
  color: var(--zb-text-muted);
  font-size: var(--zb-text-sm);
}
.tagsmod-gallery {
  display: flex;
  gap: var(--zb-space-xs);
  margin-top: var(--zb-space-sm);
  padding: 2px 1px 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.tagsmod-gallery-item {
  position: relative;
  display: block;
  flex: 0 0 clamp(86px, 13vw, 132px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: var(--zb-radius-sm);
  background: var(--zb-surface-sunken);
  cursor: pointer;
  opacity: .72;
  transition: border-color var(--zb-duration-fast) var(--zb-ease), opacity var(--zb-duration-fast) var(--zb-ease), transform var(--zb-duration-fast) var(--zb-ease);
}
.tagsmod-gallery-item:hover { opacity: 1; transform: translateY(-1px); }
.tagsmod-gallery-item.is-active,
.tagsmod-gallery-item[aria-current="true"] { border-color: var(--zb-primary); opacity: 1; box-shadow: 0 0 0 1px var(--zb-primary-soft-border); }
.tagsmod-gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 相关资源入口：跳到下方关联资源列表；没有资源时只留一行普通提示 */
.tagsmod-resource-link {
  display: flex;
  align-items: center;
  gap: var(--zb-space-xs);
  min-height: 44px;
  padding: 0 var(--zb-space-md);
  border: 1px solid var(--zb-border);
  border-radius: var(--zb-radius-md);
  background: var(--zb-surface);
  color: var(--zb-link);
  font-size: var(--zb-text-sm);
  font-weight: var(--zb-weight-semibold);
  transition: border-color var(--zb-duration-base) var(--zb-ease), background-color var(--zb-duration-base) var(--zb-ease);
}
.tagsmod-resource-link > span { flex: 1 1 auto; }
.tagsmod-resource-link .tagsmod-ico { flex: none; width: var(--zb-icon-sm); height: var(--zb-icon-sm); }
.tagsmod-resource-link:hover { border-color: var(--zb-primary-soft-border-strong); background: var(--zb-primary-soft); color: var(--zb-primary-soft-text); }
.tagsmod-resource-link:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-feature-resource .tagsmod-empty-note { padding: var(--zb-space-xs) 0; text-align: center; }

.tagsmod-source-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zb-space-sm);
  min-height: 58px;
  padding: var(--zb-space-sm) var(--zb-space-md);
  border: 1px solid var(--zb-primary-soft-border-strong);
  border-radius: var(--zb-radius-md);
  background: var(--zb-primary-soft);
  color: var(--zb-primary-soft-text);
  transition: transform var(--zb-duration-fast) var(--zb-ease), border-color var(--zb-duration-base) var(--zb-ease), background-color var(--zb-duration-base) var(--zb-ease);
}
.tagsmod-source-primary:hover { border-color: var(--zb-primary); transform: translateY(-1px); }
.tagsmod-source-primary:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-source-primary > .tagsmod-ico { width: var(--zb-icon-md); height: var(--zb-icon-md); }
.tagsmod-source-copy { display: grid; gap: 3px; min-width: 0; }
.tagsmod-source-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--zb-text-sm); }
.tagsmod-source-copy small,
.tagsmod-source-list small { color: var(--zb-text-muted); font-size: var(--zb-text-xs); }
.tagsmod-source-list { display: grid; gap: 2px; margin: var(--zb-space-sm) 0 0; }
.tagsmod-source-list li { list-style: none; }
.tagsmod-source-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zb-space-sm);
  padding: var(--zb-space-xs) 0;
  color: var(--zb-text-soft);
  border-bottom: 1px solid var(--zb-border);
}
.tagsmod-source-list li:last-child a { border-bottom: 0; padding-bottom: 0; }
.tagsmod-source-list a:hover { color: var(--zb-link); }
.tagsmod-source-list a:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); border-radius: var(--zb-radius-xs); }
.tagsmod-source-list a > span { display: grid; gap: 2px; min-width: 0; overflow: hidden; }
.tagsmod-source-list a .tagsmod-ico { flex: 0 0 auto; }

.tagsmod-related { scroll-margin-top: 88px; }
.tagsmod-related .tagsmod-card-title { flex-wrap: wrap; }
.tagsmod-posts { display: grid; gap: 4px; }
.tagsmod-posts a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--zb-space-xs);
  min-height: 44px;
  padding: var(--zb-space-xs) 0;
  border-bottom: 1px solid var(--zb-border);
  color: var(--zb-link);
  font-size: var(--zb-text-sm);
}
.tagsmod-posts li:last-child a { border-bottom: 0; }
.tagsmod-posts a:hover { color: var(--zb-primary); }
.tagsmod-posts a:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); border-radius: var(--zb-radius-xs); }
.tagsmod-post-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagsmod-post-date { color: var(--zb-text-muted); font-size: var(--zb-text-xs); white-space: nowrap; }
.tagsmod-posts a > .tagsmod-ico { color: var(--zb-text-muted); }

.tagsmod-tags-list { transition: max-height var(--zb-duration-base) var(--zb-ease); }
.tagsmod-tags-toggle,
.tagsmod-related-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--zb-space-2xs);
  min-height: 34px;
  margin-top: var(--zb-space-sm);
  padding: 0 var(--zb-space-sm);
  border: 1px solid var(--zb-border);
  border-radius: var(--zb-radius-pill);
  background: var(--zb-surface);
  color: var(--zb-link);
  font-size: var(--zb-text-xs);
  cursor: pointer;
}
.tagsmod-tags-toggle:hover,
.tagsmod-related-toggle:hover { border-color: var(--zb-primary-soft-border-strong); background: var(--zb-primary-soft); }
.tagsmod-tags-toggle:focus-visible,
.tagsmod-related-toggle:focus-visible { outline: none; box-shadow: var(--zb-focus-ring); }
.tagsmod-tags-toggle .tagsmod-ico,
.tagsmod-related-toggle .tagsmod-ico,
.tagsmod-maker-toggle .tagsmod-ico { transition: transform var(--zb-duration-fast) var(--zb-ease); }
.tagsmod-tags-toggle[aria-expanded="true"] .tagsmod-ico,
.tagsmod-related-toggle[aria-expanded="true"] .tagsmod-ico,
.tagsmod-maker-toggle[aria-expanded="true"] .tagsmod-ico { transform: rotate(180deg); }
/* 关联资源的「展开全部」在列表末尾占满一行，保留 44px 触控高度 */
.tagsmod-related-toggle { justify-content: center; width: 100%; min-height: 44px; font-size: var(--zb-text-sm); }
/* 制作信息的展开按钮始终贴在卡片底边：收起时实底加上方渐隐遮住截断处，展开后两者淡出；只在宽屏出现 */
.tagsmod-maker-toggle {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--zb-space-2xs);
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0 0 var(--zb-radius-lg) var(--zb-radius-lg);
  background: var(--zb-surface);
  color: var(--zb-link);
  font-size: var(--zb-text-xs);
  cursor: pointer;
  transition: background-color var(--zb-duration-slow) var(--zb-ease), color var(--zb-duration-fast) var(--zb-ease);
}
.tagsmod-maker-toggle::before {
  content: '';
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 32px;
  background: linear-gradient(to bottom, transparent, var(--zb-surface));
  pointer-events: none;
  transition: opacity var(--zb-duration-slow) var(--zb-ease);
}
.tagsmod-maker-toggle:hover { color: var(--zb-primary); }
.tagsmod-maker-toggle:focus-visible { outline: none; }
.tagsmod-maker-toggle:focus-visible > span { border-radius: var(--zb-radius-xs); box-shadow: var(--zb-focus-ring); }
.tagsmod-maker-toggle[hidden] { display: none; }
.tagsmod-empty-note { margin: 0; }
.tagsmod-description-card { scroll-margin-top: 88px; }

@media (max-width: 991.98px) {
  /* 单列时拆开左右栏，按手机常见顺序排：主图（封面为第一张）→ 相关资源入口 → 外部来源 → 作品概要 → 制作信息 → 完整介绍 → 关联资源 */
  .tagsmod-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .tagsmod-detail-feature,
  .tagsmod-feature-sidebar,
  .tagsmod-detail-content,
  .tagsmod-resource-rail { display: contents; }
  .tagsmod-preview-card { order: 1; }
  .tagsmod-feature-resource { order: 2; }
  .tagsmod-source-card { order: 3; }
  .tagsmod-sidebar-overview { order: 4; }
  .tagsmod-feature-maker { order: 5; }
  .tagsmod-description-card { order: 6; }
  .tagsmod-related { order: 7; position: static; }
  /* 封面已并入主图（没有截图时主图本来就是封面），右栏的封面与空占位不再单独显示 */
  .tagsmod-cover-link,
  .tagsmod-cover-empty { display: none; }
  /* 单列不限高，制作信息总是完整显示 */
  .tagsmod-maker-toggle { display: none !important; }
}
@media (min-width: 992px) {
  .tagsmod-gallery-item--cover { display: none; }
  /* 右栏不参与行高，默认限在主图高度内：封面在上、相关资源入口贴底，制作信息吸收差额，放不下时由按钮展开后自然撑高 */
  .tagsmod-feature-sidebar:not(.is-expanded) {
    contain: size;
    display: grid;
    grid-template-rows: minmax(0, max-content) minmax(0, 1fr) auto;
  }
  .tagsmod-feature-sidebar:not(.is-expanded) > :is(.tagsmod-cover-link, .tagsmod-cover-empty) { grid-row: 1; }
  .tagsmod-feature-sidebar:not(.is-expanded) .tagsmod-cover-img { height: 100%; object-fit: cover; }
  .tagsmod-feature-sidebar:not(.is-expanded) > .tagsmod-feature-maker { grid-row: 2; align-self: start; max-height: 100%; }
  .tagsmod-feature-sidebar:not(.is-expanded) > .tagsmod-feature-resource { grid-row: 3; }
  /* 卡片始终裁切内容：按钮贴底，展开/收起的高度动画也靠它遮住尚未露出的部分 */
  .tagsmod-feature-maker { position: relative; overflow: hidden; }
  /* 展开后给贴底按钮留位；收起动画期间（is-collapsing）按钮先恢复遮罩，结束时与限高状态无缝衔接 */
  .tagsmod-feature-sidebar.is-expanded > .tagsmod-feature-maker { padding-bottom: 44px; }
  .tagsmod-feature-sidebar.is-expanded:not(.is-collapsing) .tagsmod-maker-toggle { background-color: transparent; }
  .tagsmod-feature-sidebar.is-expanded:not(.is-collapsing) .tagsmod-maker-toggle::before { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tagsmod-maker-toggle,
  .tagsmod-maker-toggle::before,
  .tagsmod-maker-toggle .tagsmod-ico { transition: none; }
}
@media (max-width: 767.98px) {
  .tagsmod-detail-grid { gap: var(--zb-space-md); }
  .tagsmod-preview-card { padding: var(--zb-space-xs); }
  /* 手机端保留最小高度；不按 16:9 推算，否则最小高度会经比例反推出更宽的舞台而溢出卡片 */
  .tagsmod-detail-feature .tagsmod-preview-stage,
  .tagsmod-detail-feature .tagsmod-preview-empty { min-height: 220px; aspect-ratio: auto; }
  .tagsmod-detail-feature .tagsmod-preview-stage { display: flex; align-items: center; }
  .tagsmod-preview-control { width: 36px; height: 36px; }
  .tagsmod-preview-prev { left: var(--zb-space-xs); }
  .tagsmod-preview-next { right: var(--zb-space-xs); }
  .tagsmod-gallery-item { flex-basis: 92px; }
  .tagsmod-tags-list.is-collapsed { max-height: 68px; overflow: hidden; }
  .tagsmod-tags-toggle[hidden],
  .tagsmod-related-toggle[hidden] { display: none; }
  .tagsmod-posts.is-collapsed > li:nth-child(n+6) { display: none; }
  .tagsmod-posts a { grid-template-columns: minmax(0, 1fr) auto; }
  .tagsmod-posts a > .tagsmod-ico { display: none; }
  .tagsmod-post-date { font-size: 10px; }
}
@media (min-width: 768px) {
  .tagsmod-tags-toggle,
  .tagsmod-related-toggle { display: none !important; }
}
