/* ===== Site Footer (ICP) ===== */
.site-footer {
  text-align: center;
  padding: 24px 0 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.icp-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-text-secondary);
  font-size: 11px;
  text-decoration: none;
  transition: color 0.2s;
}

.icp-link:hover {
  color: var(--color-blue-light);
}

.footer-sep {
  color: var(--color-border);
  font-size: 11px;
}

.beian-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  vertical-align: middle;
}

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  --color-deep: #0A1628;
  --color-brand: #2563EB;
  --color-brand-light: #3B82F6;
  --color-ice: #60A5FA;
  --color-bg: #0B1120;
  --color-bg-elevated: #111B2E;
  --color-card: #141E30;
  --color-card-hover: #1A2740;
  --color-text: #E8EDF5;
  --color-text-secondary: #8B9BB8;
  --color-border: #1E2D45;
  --gradient-brand: linear-gradient(135deg, #1E40AF, #3B82F6);
  --font-heading: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-card-hover: 0 8px 30px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(37, 99, 235, 0.1);
  --shadow-nav: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: auto;
  overflow-x: hidden;
  /* Firefox: completely hide scrollbar */
  scrollbar-width: none;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* --- Hide native scrollbar completely (Windows classic scrollbar takes layout space) --- */
/* Users scroll via mouse wheel / trackpad / keyboard / touch */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* --- Floating scroll progress indicator (no layout impact) --- */
.scroll-progress {
  position: fixed;
  right: 0;
  top: 0;
  width: 3px;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
  background: transparent;
}
.scroll-progress-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background: rgba(37, 99, 235, 0.35);
  border-radius: 0 0 2px 2px;
  transition: height 0.1s ease;
}
.scroll-progress:hover .scroll-progress-thumb {
  background: rgba(37, 99, 235, 0.6);
  width: 5px;
}

/* ============================================
   FLOATING ACTION BUTTONS (common)
   ============================================ */
.btn-back-top,
.btn-download,
.btn-replay {
  position: fixed;
  z-index: 999;
  right: 24px;
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 10px;
  background: rgba(20, 30, 48, 0.85);
  backdrop-filter: blur(8px);
  color: #60A5FA;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, border-color 0.2s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.btn-back-top.visible,
.btn-download.visible,
.btn-replay.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.btn-replay.visible {
  opacity: 0.6;
}

.btn-back-top:hover,
.btn-download:hover,
.btn-replay:hover {
  opacity: 1 !important;
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.6);
  color: #93C5FD;
}

.btn-back-top:active,
.btn-download:active,
.btn-replay:active {
  transform: translateY(0) scale(0.95);
}

/* Back to Top */
.btn-back-top {
  bottom: 32px;
  width: 42px;
  height: 42px;
}

/* Download Portfolio (portfolio page only) */
.btn-download {
  bottom: 82px;
  height: 42px;
  padding: 10px 14px;
}

.btn-download-label {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Replay Welcome Video (portfolio page only, subtle) */
.btn-replay {
  bottom: 130px;
  height: 36px;
  padding: 8px 10px;
  font-size: 9px;
}

.btn-replay svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-replay-label {
  font-size: 9px;
  font-weight: 500;
}

/* ===== Welcome Video Popup ===== */
.welcome-popup {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.welcome-popup.active {
  opacity: 1;
  visibility: visible;
}

.welcome-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.88);
  backdrop-filter: blur(8px);
}

.welcome-content {
  position: relative;
  width: 90%;
  max-width: 688px;
  border-radius: 12px;
  overflow: hidden;
  background: #141E30;
  border: 1px solid #1E2D45;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.welcome-popup.active .welcome-content {
  transform: scale(1);
}

.welcome-content video {
  display: block;
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #000;
}

.welcome-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(96, 136, 209, 0.5);
  border-radius: 50%;
  background: rgba(20, 30, 48, 0.95);
  color: rgba(96, 136, 209, 0.85);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.welcome-close:hover {
  color: #E8EDF5;
  background: rgba(37, 99, 235, 0.3);
}



/* ============================================
   SCROLLING NOTICE BAR
   ============================================ */
.notice-bar {
  width: auto;
  overflow: hidden;
  background: linear-gradient(90deg, #0D1A2D, #111E35, #0D1A2D);
  height: 28px;
  line-height: 28px;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
}
.notice-track {
  display: flex;
  animation: notice-scroll 40s linear infinite;
  white-space: nowrap;
}
.notice-text {
  color: #8B9BB8;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding-right: 96px;
  flex-shrink: 0;
}
.notice-bar:hover .notice-track {
  animation-play-state: paused;
}
@keyframes notice-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-33.333%); }
}

/* Setup hint banner */
#setupHint {
  background: linear-gradient(135deg, #1E40AF22, #3B82F622);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 20px;
  text-align: center;
  font-size: 11px;
  color: #8B9BB8;
  position: relative;
  z-index: 100;
}
#setupHint code {
  font-size: 10px;
}

/* Image fallback block */
.img-fallback {
  border: 1px dashed var(--color-border);
  border-radius: 8px;
}

/* Loading indicator */
#imageLoader {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #60A5FA;
  font-size: 11px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.loader-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: #60A5FA;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty hint for sections */
.empty-hint {
  text-align: center;
  padding: 80px 20px;
  color: #64748B;
  font-size: 13px;
  line-height: 2;
}
.empty-hint small {
  color: #475569;
  font-size: 10px;
}

/* ============================================
   BACKGROUND CANVAS
   ============================================ */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

/* ============================================
   NAVIGATION - WHEEL/DIAL STYLE
   ============================================ */
.nav-wheel {
  position: fixed;
  top: 28px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(11, 17, 32, 0.95) 0%, rgba(11, 17, 32, 0.88) 10%);
  backdrop-filter: blur(10px) saturate(10%);
  -webkit-backdrop-filter: blur(10px) saturate(10%);
}

.nav-wheel-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  background: var(--color-card);
  border-radius: 50px;
  box-shadow: var(--shadow-nav);
  border: 1px solid rgba(30, 45, 69, 0.8);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-wheel-inner::-webkit-scrollbar {
  display: none;
}

.nav-indicator {
  position: absolute;
  height: calc(100% - 10px);
  border-radius: 44px;
  background: var(--gradient-brand);
  transition: left 0.45s var(--ease-bounce), width 0.35s var(--ease-smooth);
  z-index: 0;
  top: 5px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 44px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: color 0.3s var(--ease-smooth);
}

.nav-item.active {
  color: #FFFFFF;
}

.nav-item:hover:not(.active) {
  color: var(--color-brand);
}

.nav-icon {
  font-size: 8px;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-label {
  letter-spacing: 0.02em;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  padding-top: 108px;
  min-height: 100vh;
}

.section {
  display: none;
  animation: sectionFadeIn 0.5s var(--ease-smooth);
}

.section.active {
  display: block;
}

@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Header */
.section-header {
  text-align: center;
  padding: 48px 20px 40px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.section-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ============================================
   PORTFOLIO SECTION - VERTICAL SCROLL
   ============================================ */
.portfolio-container {
  max-width: 688px;
  margin: 0 auto;
  padding: 0 20px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.portfolio-item {
  position: relative;
  width: 100%;
  max-width: 640px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.portfolio-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-item-inner {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.4s var(--ease-smooth), transform 0.4s var(--ease-smooth);
  background: var(--color-card);
}

.portfolio-item:hover .portfolio-item-inner {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.portfolio-item-inner img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s var(--ease-smooth);
}

.portfolio-item:hover .portfolio-item-inner img {
  transform: scale(1.01);
}

/* Layered depth effect - alternating subtle offsets */
.portfolio-item:nth-child(odd) {
  margin-left: -12px;
}

.portfolio-item:nth-child(even) {
  margin-right: -12px;
}

/* Staggered z-index for layering */
.portfolio-item:nth-child(3n) {
  z-index: 3;
}

.portfolio-item:nth-child(3n+1) {
  z-index: 2;
}

.portfolio-item:nth-child(3n+2) {
  z-index: 1;
}

/* Spacing between items */
.portfolio-item + .portfolio-item {
  margin-top: -20px;
}

/* First and last items no overlap */
.portfolio-item:first-child {
  margin-top: 0;
}

/* Decorative edge glow on hover */
.portfolio-item-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity 0.4s;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.15);
  pointer-events: none;
}

.portfolio-item:hover .portfolio-item-inner::after {
  opacity: 1;
}

/* ============================================
   MASONRY GRID (Waterfall Layout)
   ============================================ */
.masonry-grid {
  column-count: 4;
  column-gap: 18px;
  padding: 0 40px 80px;
  max-width: 1120px;
  margin: 0 auto;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s var(--ease-smooth), transform 0.5s var(--ease-smooth);
}

/* ── Masonry card (JS-generated class names) ── */
.masonry-card {
  break-inside: avoid;
  margin-bottom: 18px;
  background: var(--color-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  position: relative;
  transition: transform 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}

.masonry-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.masonry-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s var(--ease-smooth);
}

.masonry-card:hover .masonry-img {
  transform: scale(1.02);
}

.masonry-label {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--color-border);
  transition: color 0.3s;
}

.masonry-card:hover .masonry-label {
  color: var(--color-brand);
}

.masonry-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.masonry-item-inner {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}

.masonry-item:hover .masonry-item-inner {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.masonry-item-inner img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s var(--ease-smooth);
}

.masonry-item:hover .masonry-item-inner img {
  transform: scale(1.02);
}

.masonry-item-label {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--color-border);
  transition: color 0.3s;
}

.masonry-item:hover .masonry-item-label {
  color: var(--color-brand);
}

/* ============================================
   GOOGLE ADS GRID
   ============================================ */
.ads-grid {
  column-count: 4;
  column-gap: 18px;
  padding: 0 40px 80px;
  max-width: 1120px;
  margin: 0 auto;
}

.ads-item {
  break-inside: avoid;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s var(--ease-smooth), transform 0.5s var(--ease-smooth);
}

.ads-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.ads-item-inner {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}

.ads-item:hover .ads-item-inner {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.ads-item-inner img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s var(--ease-smooth);
}

.ads-item:hover .ads-item-inner img {
  transform: scale(1.02);
}

.ads-item-label {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--color-border);
  transition: color 0.3s;
}

.ads-item:hover .ads-item-label {
  color: var(--color-brand);
}

/* Badge for ads indicating group */
.ads-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  background: rgba(10, 22, 40, 0.7);
  border-radius: 6px;
  font-size: 9px;
  color: var(--color-text-primary);
  pointer-events: none;
}

/* ── Ads card (JS-generated class names) ── */
.ads-card {
  break-inside: avoid;
  margin-bottom: 24px;
  background: var(--color-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
  display: flex;
  flex-direction: column;
}

.ads-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}

.ads-img {
  width: 100%;
  height: auto;
  display: block;
  flex-shrink: 0;
  transition: transform 0.5s var(--ease-smooth);
}

.ads-card:hover .ads-img {
  transform: scale(1.02);
}

.ads-label {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--color-border);
  transition: color 0.3s;
  flex-shrink: 0;
}

.ads-card:hover .ads-label {
  color: var(--color-brand);
}

/* ============================================
   COMPACT CARDS (Websites / Detail Pages)
   ============================================ */
.compact-grid {
  column-count: 4;
  column-gap: 24px;
  padding: 0 24px;
}

.compact-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
  break-inside: avoid;
}

.compact-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.15);
}

.compact-card img {
  width: 100%;
  display: block;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.compact-card:hover img {
  transform: scale(1.03);
}

.compact-label {
  padding: 10px 12px;
  font-size: 10px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--color-border);
  transition: color 0.3s;
  flex-shrink: 0;
}

.compact-card:hover .compact-label {
  color: var(--color-brand);
}

/* ============================================
   LIGHTBOX (Google Ads)
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s var(--ease-smooth);
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lightbox-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 757px;
  max-height: 90vh;
  animation: lightboxIn 0.4s var(--ease-bounce);
}

@keyframes lightboxIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s, color 0.3s;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.lightbox-body {
  display: flex;
  gap: 16px;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(10, 22, 40, 0.25);
}

.lightbox-main {
  flex: 1;
  min-width: 0;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  overflow: hidden;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.lightbox-sidebar {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
  background: var(--color-card);
  border-left: 1px solid var(--color-border);
}

.lightbox-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s, transform 0.3s;
  flex-shrink: 0;
}

.lightbox-thumb:hover {
  border-color: var(--color-ice);
  transform: scale(1.03);
}

.lightbox-thumb.active {
  border-color: var(--color-brand);
}

.lightbox-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.thumb-name {
  display: block;
  font-size: 8px;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-thumb.active {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-label {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

/* ============================================
   IMAGE VIEWER (for non-ads sections)
   ============================================ */
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s var(--ease-smooth);
}

.image-viewer.active {
  display: flex;
  opacity: 1;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.image-viewer-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 92vh;
  animation: lightboxIn 0.4s var(--ease-bounce);
}

.image-viewer-close {
  position: absolute;
  top: -44px;
  right: -4px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s, color 0.3s;
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.image-viewer-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 80px rgba(10, 22, 40, 0.3);
}

.image-viewer-label {
  margin-top: 14px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .masonry-grid,
  .ads-grid,
  .compact-grid {
    column-count: 3;
  }
}

@media (max-width: 900px) {
  .masonry-grid,
  .ads-grid,
  .compact-grid {
    column-count: 2;
    padding: 0 20px 60px;
  }

  .nav-item {
    padding: 7px 12px;
    font-size: 10px;
  }

  .nav-icon {
    display: none;
  }

  .portfolio-container {
    padding: 0 16px 60px;
  }

  .portfolio-item:nth-child(odd),
  .portfolio-item:nth-child(even) {
    margin-left: 0;
    margin-right: 0;
  }

  .lightbox-body {
    flex-direction: column;
    max-width: 95vw;
  }

  .lightbox-sidebar {
    width: 100%;
    flex-direction: row;
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding: 10px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .lightbox-thumb {
    width: 80px;
    aspect-ratio: 1;
    flex-shrink: 0;
  }
}

@media (max-width: 600px) {
  .masonry-grid,
  .ads-grid {
    column-count: 2;
    column-gap: 10px;
    padding: 0 10px 30px;
  }

  .masonry-card,
  .ads-card {
    margin-bottom: 10px;
  }

  .section-header {
    padding: 24px 12px 16px;
  }

  .section-title {
    font-size: 16px;
  }

  .nav-wheel {
    padding: 6px 8px;
  }

  .nav-wheel-inner {
    gap: 2px;
    padding: 3px;
  }

  .nav-item {
    padding: 5px 8px;
    font-size: 9px;
    gap: 3px;
  }

  .portfolio-container {
    padding: 0 8px 40px;
  }

  .portfolio-item {
    border-radius: 8px;
  }

  .ads-label,
  .masonry-label {
    font-size: 9px;
    padding: 5px 6px;
  }

  /* Lightbox full screen on mobile */
  .lightbox-body {
    flex-direction: column;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .lightbox-main {
    max-height: 60vh;
  }

  .lightbox-sidebar {
    width: 100%;
    flex-direction: row;
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: 30vh;
  }

  .lightbox-thumb {
    width: 60px;
    height: 80px;
    flex-shrink: 0;
  }

  /* Image viewer full screen on mobile */
  .viewer-content {
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  /* Scroll marquee smaller on mobile */
  .scroll-marquee {
    font-size: 8px;
    padding: 3px 0;
  }

  .btn-back-top {
    bottom: 20px;
    right: 16px;
    width: 38px;
    height: 38px;
  }

  .btn-download {
    bottom: 66px;
    right: 16px;
    height: 38px;
    padding: 8px 10px;
  }

  .btn-download-label {
    font-size: 9px;
  }

  .btn-replay {
    bottom: 110px;
    right: 16px;
    height: 32px;
    padding: 6px 8px;
  }

  .btn-replay-label {
    font-size: 8px;
  }

  .welcome-content {
    width: 95%;
    max-width: 100%;
    border-radius: 8px;
  }

  .welcome-close {
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
}

/* ============================================
   LOADING SHIMMER
   ============================================ */
.shimmer {
  background: linear-gradient(
    90deg,
    #141E30 25%,
    #1E2D45 50%,
    #141E30 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.25);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, 0.4);
}

/* Portfolio image spacing */
.portfolio-container img {
  margin-bottom: 10px;
  border-radius: 12px;
}
/* Scroll Viewer - for long images */
.scroll-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  --vw: 777px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.scroll-viewer.active {
  opacity: 1;
  visibility: visible;
}
/* 放大模式由 JS 动态设置 --vw，不在此处固定 */
.scroll-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(8px);
}
.scroll-viewer-content {
  position: relative;
  z-index: 1;
  max-width: var(--vw);
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 12px;
  background: #0B1120;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(96,165,250,0.3) transparent;
}
.scroll-viewer-content::-webkit-scrollbar {
  width: 6px;
}
.scroll-viewer-content::-webkit-scrollbar-track {
  background: transparent;
}
.scroll-viewer-content::-webkit-scrollbar-thumb {
  background: rgba(96,165,250,0.3);
  border-radius: 3px;
}
.scroll-viewer-content img {
  display: block;
  border-radius: 8px;
  margin: 0 auto;
  cursor: zoom-in;
  transition: max-height 0.3s ease;
}
.scroll-viewer-content img.sv-img-fit {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}
.scroll-viewer-content.sv-zoomed {
  overflow-x: auto;
}
.scroll-viewer-content img.sv-img-full {
  max-height: none;
  width: auto;
  height: auto;
  cursor: zoom-out;
  /* 宽度由 JS 动态设置 inline style */
}
.scroll-viewer-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(96, 136, 209, 0.85);
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.scroll-viewer-close:hover {
  background: rgba(96, 136, 209, 1);
}

/* 查看器翻页按钮 */
.sv-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(96, 136, 209, 0.85);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.3s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.sv-nav-btn:hover {
  background: rgba(96, 136, 209, 1);
}
.sv-nav-prev { left: 20px; }
.sv-nav-next { right: 20px; }
.sv-nav-btn.hidden { opacity: 0; pointer-events: none; }
.scroll-viewer-counter {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--color-text-secondary);
  background: rgba(10, 22, 40, 0.6);
  padding: 3px 10px;
  border-radius: 10px;
  z-index: 10;
}
.scroll-viewer-counter.hidden { display: none; }
.scroll-viewer-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--color-text-secondary);
  font-size: 10px;
  background: rgba(20, 30, 48, 0.8);
  padding: 6px 16px;
  border-radius: 20px;
  pointer-events: none;
  animation: sv-hint-fade 3s ease forwards;
}

@keyframes sv-hint-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

/* Unsupported video placeholder */
.video-unsupported {
  background: var(--color-card);
  border-radius: 8px;
}

/* Video Player Popup */
.video-player {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.video-player.active {
  opacity: 1;
  visibility: visible;
}
.video-player-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.video-player-content {
  position: relative;
  z-index: 1;
  width: 85vw;
  max-width: 768px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 60px rgba(37, 99, 235, 0.15);
}
.video-player-content video {
  display: block;
  width: 100%;
  max-height: 85vh;
}
.video-player-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(10, 22, 40, 0.85);
  border: 1px solid rgba(96, 136, 209, 0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.video-player-close:hover {
  background: rgba(37, 99, 235, 0.6);
}

/* Video card play overlay */
.masonry-card video {
  width: 100%;
  display: block;
  border-radius: 12px 12px 0 0;
  background: #000;
  pointer-events: none;  /* 让点击穿透到卡片，不拦截事件 */
}
.masonry-card video::-webkit-media-controls {
  opacity: 1;
}
.video-play-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(37, 99, 235, 0.85);
  color: #fff;
  font-size: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
}

/* 视频卡片播放按钮覆盖层 */
.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.25s ease;
  background: linear-gradient(180deg, rgba(10,22,40,0.2) 0%, rgba(10,22,40,0.45) 100%);
  border-radius: 12px 12px 0 0;
}
.video-play-overlay svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.masonry-card:hover .video-play-overlay {
  opacity: 0;
}
/* 视频弹窗 body 容器 */
.video-player-body {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 768px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 60px rgba(37, 99, 235, 0.15);
}
.video-player-body video {
  display: block;
  width: 100%;
  max-height: 85vh;
}
