
@scope (body:has(.gallery-shell)) {

:scope {
  --gal-bg: #f6f8fc;
  --gal-card-bg: rgba(255, 255, 255, 0.9);
  --gal-ink: #2c3345;
  --gal-muted: #79839e;
  --gal-border: rgba(120, 140, 200, 0.16);
  --gal-primary: #587cf0;
  --gal-pink: #f472b6;
  --gal-purple: #8b5cf6;
  --gal-shadow: 0 10px 30px rgba(70, 95, 160, 0.08);
  --gal-hover-shadow: 0 20px 40px rgba(60, 85, 170, 0.18);
}

/* Reset Hexo theme container constraints for full-width immersive view */
#content-inner.layout {
  max-width: 1480px !important;
  width: 95% !important;
  padding: 20px 10px !important;
}
#aside-content {
  display: none !important;
}
#page {
  width: 100% !important;
  padding: 0 !important;
  border-radius: 16px;
  background: transparent !important;
  box-shadow: none !important;
}
#article-container {
  padding: 0 !important;
}

/* Gallery Shell */
.gallery-shell {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--gal-ink);
  margin-bottom: 50px;
}

/* Hero Section */
.gallery-hero {
  position: relative;
  text-align: center;
  padding: 55px 24px 40px;
  margin-bottom: 32px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(238, 244, 255, 0.85) 0%, rgba(254, 240, 250, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--gal-shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.gallery-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.35), transparent 70%);
  pointer-events: none;
}
.gallery-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--gal-primary), var(--gal-purple));
  box-shadow: 0 4px 14px rgba(88, 124, 240, 0.35);
  margin-bottom: 14px;
}
.gallery-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0 0 12px;
  color: #1f2742;
  border: none;
}
.gallery-hero p {
  font-size: 15px;
  color: var(--gal-muted);
  max-width: 680px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

/* Stat counters */
.gallery-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.gallery-stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--gal-border);
  padding: 6px 16px;
  border-radius: 12px;
  font-size: 13px;
  color: #4b5563;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.gallery-stat-pill strong {
  color: var(--gal-primary);
  font-weight: 700;
}

/* Controls Bar */
.gallery-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--gal-border);
  border-radius: 16px;
  box-shadow: var(--gal-shadow);
  backdrop-filter: blur(10px);
}
.gallery-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.gallery-tab {
  border: none;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gal-muted);
  cursor: pointer;
  transition: all 0.25s ease;
}
.gallery-tab:hover {
  color: var(--gal-primary);
  background: rgba(88, 124, 240, 0.08);
}
.gallery-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--gal-primary), var(--gal-purple));
  box-shadow: 0 4px 12px rgba(88, 124, 240, 0.28);
}
.gallery-search {
  position: relative;
  min-width: 240px;
}
.gallery-search input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  border-radius: 999px;
  border: 1px solid var(--gal-border);
  background: rgba(245, 248, 255, 0.7);
  color: var(--gal-ink);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gallery-search input:focus {
  border-color: var(--gal-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(88, 124, 240, 0.15);
}
.gallery-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gal-muted);
  font-size: 13px;
}

/* Image Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}
.gallery-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--gal-border);
  box-shadow: var(--gal-shadow);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}
.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--gal-hover-shadow);
}

/* Image Preview Container */
.gallery-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 60%; /* 16:9.6 aspect ratio */
  overflow: hidden;
  background: #edf2f7;
  cursor: pointer;
}
.gallery-img-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-card:hover .gallery-img-wrap img {
  transform: scale(1.06);
}
.gallery-tag-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  color: #fff;
  background: rgba(30, 41, 59, 0.72);
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* Hover Action Bar (Image-bed utilities) */
.gallery-overlay-actions {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 3;
}
.gallery-card:hover .gallery-overlay-actions {
  opacity: 1;
}
.gal-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #1e293b;
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.gal-action-btn:hover {
  transform: scale(1.12);
  background: var(--gal-primary);
  color: #fff;
}

/* Card Footer */
.gallery-card-info {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gallery-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-card-desc {
  font-size: 12px;
  color: var(--gal-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.gallery-btn-copy-md {
  border: none;
  background: rgba(88, 124, 240, 0.08);
  color: var(--gal-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s, color 0.2s;
}
.gallery-btn-copy-md:hover {
  background: var(--gal-primary);
  color: #fff;
}
.gallery-btn-link {
  border: none;
  background: transparent;
  color: var(--gal-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
}
.gallery-btn-link:hover {
  color: var(--gal-primary);
}

/* Lightbox Modal */
.gal-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(16px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gal-lightbox.show {
  display: flex;
  opacity: 1;
}
.gal-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gal-lightbox-img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}
.gal-lightbox-caption {
  margin-top: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 14px;
}
.gal-lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s;
}
.gal-lightbox-close:hover {
  background: rgba(239, 68, 68, 0.8);
  transform: scale(1.08);
}
.gal-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s;
}
.gal-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%) scale(1.1);
}
.gal-lightbox-prev { left: 24px; }
.gal-lightbox-next { right: 24px; }

/* Toast Notification */
.gal-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: #1e293b;
  color: #fff;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.28s ease;
}
.gal-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Random Anime Section */
.random-anime-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 248, 255, 0.9));
  border: 1px solid var(--gal-border);
  border-radius: 20px;
  box-shadow: var(--gal-shadow);
  backdrop-filter: blur(12px);
  padding: 24px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.random-anime-card:hover {
  box-shadow: var(--gal-hover-shadow);
}
@media (max-width: 900px) {
  .random-anime-card {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 20px;
  }
}
.random-anime-preview-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #0e1726;
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.16);
  cursor: pointer;
}
.random-anime-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.3s ease;
}
.random-anime-preview-wrap:hover .random-anime-img {
  transform: scale(1.04);
}
.random-anime-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  color: #fff;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}
.random-anime-loading {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  gap: 10px;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.random-anime-loading.active {
  opacity: 1;
  pointer-events: auto;
}
.random-anime-loading i {
  font-size: 20px;
  animation: galSpin 1s linear infinite;
}
@keyframes galSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.random-anime-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.random-anime-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}
.random-anime-title {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  line-height: 1.3;
}
.random-anime-desc {
  font-size: 13px;
  color: var(--gal-muted);
  line-height: 1.6;
  margin: 0;
}
.random-anime-url-box {
  background: #f1f5f9;
  border: 1px solid var(--gal-border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.random-anime-url-text {
  font-family: monospace;
  font-size: 12px;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
}
.random-anime-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.random-btn {
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.random-btn-primary {
  background: linear-gradient(135deg, var(--gal-primary), var(--gal-purple));
  color: #fff;
  box-shadow: 0 4px 14px rgba(88, 124, 240, 0.3);
}
.random-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(88, 124, 240, 0.45);
  color: #fff;
}
.random-btn-secondary {
  background: rgba(88, 124, 240, 0.1);
  color: var(--gal-primary);
}
.random-btn-secondary:hover {
  background: rgba(88, 124, 240, 0.18);
  transform: translateY(-2px);
  color: var(--gal-primary);
}
.random-btn-outline {
  background: #fff;
  border: 1px solid var(--gal-border);
  color: #4b5563;
}
.random-btn-outline:hover {
  background: #f8fafc;
  color: var(--gal-primary);
  border-color: var(--gal-primary);
  transform: translateY(-2px);
}


}
