/**
 * CRMEB Theme Hub — UI/UX Design System v1.2
 * 设计原则：清晰层级 · 商城主题展示 · 移动优先 · 无障碍
 */

/* ── Design Tokens ── */
:root {
  --c-primary: #2563eb;
  --c-primary-hover: #1d4ed8;
  --c-primary-soft: #eff6ff;
  --c-primary-glow: rgba(37, 99, 235, 0.35);
  --c-accent: #7c3aed;
  --c-success: #059669;
  --c-success-soft: #ecfdf5;
  --c-warn: #d97706;
  --c-text: #0f172a;
  --c-text-secondary: #475569;
  --c-text-muted: #94a3b8;
  --c-border: #e2e8f0;
  --c-border-light: #f1f5f9;
  --c-surface: #ffffff;
  --c-bg: #f8fafc;
  --c-bg-elevated: #ffffff;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.04), 0 0 0 1px var(--c-border-light);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 64px;
  --container: 1140px;
  --card-media-h: 280px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

.crmeb-hub-site { width: 100%; overflow-x: hidden; }

.crmeb-hub-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.crmeb-hub-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--c-primary);
  color: #fff;
}
.crmeb-hub-skip:focus { left: 16px; top: 16px; }

/* ── Header ── */
.crmeb-hub-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}

.crmeb-hub-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}

.crmeb-hub-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--c-text);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
}
.crmeb-hub-brand:hover { color: var(--c-primary); text-decoration: none; }
.crmeb-hub-brand__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--c-primary-soft), #ede9fe);
  color: var(--c-primary);
}

.crmeb-hub-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.crmeb-hub-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  color: var(--c-text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.crmeb-hub-nav a:hover {
  color: var(--c-primary);
  background: var(--c-primary-soft);
  text-decoration: none;
}
.crmeb-hub-nav a[aria-current="page"] {
  color: var(--c-primary);
  background: var(--c-primary-soft);
}

.crmeb-hub-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  cursor: pointer;
}
.crmeb-hub-nav-toggle span {
  display: block;
  height: 2px;
  background: var(--c-text);
  border-radius: 1px;
  transition: var(--transition);
}

/* ── Hero ── */
.crmeb-hub-hero {
  position: relative;
  padding: 72px 0 64px;
  overflow: hidden;
}
.crmeb-hub-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.14), transparent),
    radial-gradient(ellipse 50% 40% at 90% 20%, rgba(124, 58, 237, 0.08), transparent),
    linear-gradient(180deg, #fff 0%, var(--c-bg) 100%);
  pointer-events: none;
}
.crmeb-hub-hero__inner {
  position: relative;
  text-align: center;
  max-width: 720px;
}
.crmeb-hub-eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--c-primary);
  background: var(--c-primary-soft);
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}
.crmeb-hub-hero__title {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-text);
}
.crmeb-hub-hero__title span {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.crmeb-hub-hero__desc {
  margin: 0 auto 28px;
  max-width: 560px;
  font-size: 1.0625rem;
  color: var(--c-text-secondary);
  line-height: 1.7;
}
.crmeb-hub-hero__actions { margin-bottom: 40px; }

.crmeb-hub-stats {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  margin: 0;
  padding: 20px 32px;
  list-style: none;
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--c-border-light);
}
.crmeb-hub-stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
}
.crmeb-hub-stats strong {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text);
}
.crmeb-hub-stats span {
  font-size: 0.75rem;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Buttons & links ── */
.crmeb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  cursor: pointer;
  border: none;
}
.crmeb-btn--primary {
  color: #fff !important;
  background: linear-gradient(135deg, var(--c-primary), #4f46e5);
  box-shadow: 0 4px 14px var(--c-primary-glow);
}
.crmeb-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--c-primary-glow);
  text-decoration: none;
  opacity: 1;
}

.crmeb-link-arrow {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: none;
}
.crmeb-link-arrow::after { content: " →"; }
.crmeb-link-arrow:hover { text-decoration: underline; }

/* ── Section ── */
.crmeb-hub-section { padding: 56px 0 72px; }
.crmeb-hub-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.crmeb-hub-section__title {
  margin: 0 0 6px;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--c-text);
}
.crmeb-hub-section__title--center { text-align: center; margin-bottom: 32px; }
.crmeb-hub-section__sub {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--c-text-muted);
}

/* ── Steps (homepage) ── */
.crmeb-hub-steps {
  padding: 56px 0 80px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}
.crmeb-hub-steps__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.crmeb-hub-steps__list li {
  padding: 24px;
  background: var(--c-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border-light);
}
.crmeb-hub-steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  background: var(--c-primary);
  border-radius: var(--radius-full);
}
.crmeb-hub-steps__list strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}
.crmeb-hub-steps__list p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--c-text-secondary);
  line-height: 1.6;
}

/* ── Badges & tags ── */
.crmeb-hub-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  line-height: 1.2;
}
.crmeb-hub-badge--free {
  color: var(--c-success);
  background: var(--c-success-soft);
}
.crmeb-hub-badge--paid {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}
.crmeb-hub-badge--lg {
  padding: 6px 14px;
  font-size: 0.8125rem;
}
.crmeb-hub-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--c-primary);
  background: var(--c-primary-soft);
  border-radius: var(--radius-sm);
}
.crmeb-hub-chip {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
}

/* ── Theme grid & card ── */
.crmeb-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.crmeb-hub-card {
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.crmeb-hub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.crmeb-hub-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.crmeb-hub-card__link:hover { text-decoration: none; color: inherit; }

.crmeb-hub-card__visual {
  position: relative;
  height: var(--card-media-h);
  background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 50%, #f1f5f9 100%);
  overflow: hidden;
}
.crmeb-hub-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
}
.crmeb-hub-card__media img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transition: transform 0.35s ease;
}
.crmeb-hub-card:hover .crmeb-hub-card__media img {
  transform: scale(1.02);
}
.crmeb-hub-card__media--banner { padding: 16px; }

.crmeb-hub-card__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  color: var(--c-text-muted);
  font-size: 0.875rem;
}
.crmeb-hub-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity var(--transition);
}
.crmeb-hub-card:hover .crmeb-hub-card__overlay,
.crmeb-hub-card:focus-within .crmeb-hub-card__overlay { opacity: 1; }
.crmeb-hub-card__cta {
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
  background: #fff;
  border-radius: var(--radius-full);
}
.crmeb-hub-card__visual > .crmeb-hub-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

.crmeb-hub-card__body { padding: 16px 18px 18px; flex: 1; }
.crmeb-hub-card__title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--c-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.crmeb-hub-card__time {
  margin: 0;
  font-size: 0.75rem;
  color: var(--c-text-muted);
}

/* ── Phone frame component ── */
.crmeb-phone {
  position: relative;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
}
.crmeb-phone--gallery { max-width: 200px; }
.crmeb-phone__bezel {
  padding: 10px 8px 12px;
  border-radius: 32px;
  background: linear-gradient(145deg, #334155 0%, #1e293b 45%, #0f172a 100%);
  box-shadow:
    0 20px 40px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
}
.crmeb-phone__screen {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #000;
  aspect-ratio: 9 / 19.5;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.crmeb-phone--scroll .crmeb-phone__screen {
  isolation: isolate;
}
.crmeb-phone__scroll {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-y;
}
.crmeb-phone__scroll::-webkit-scrollbar {
  display: none;
}
.crmeb-phone__scroll:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: -2px;
}
.crmeb-phone__island {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 2;
  width: 34%;
  height: 18px;
  transform: translateX(-50%);
  border-radius: var(--radius-full);
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.crmeb-phone__screen img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.crmeb-phone--scroll .crmeb-phone__screen img {
  height: auto;
  min-height: 100%;
  object-fit: unset;
  object-position: top center;
}
.crmeb-phone:not(.crmeb-phone--scroll) .crmeb-phone__screen img {
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.crmeb-phone__scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  transform: translateX(-50%);
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
  animation: crmeb-scroll-hint 1.8s ease-in-out infinite;
  transition: opacity var(--transition);
}
.crmeb-phone__scroll.is-at-bottom + .crmeb-phone__scroll-hint,
.crmeb-phone__scroll.is-fit + .crmeb-phone__scroll-hint,
.crmeb-phone__scroll.is-scrolling + .crmeb-phone__scroll-hint {
  opacity: 0;
}
@keyframes crmeb-scroll-hint {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.85; }
  50% { transform: translateX(-50%) translateY(4px); opacity: 1; }
}
.crmeb-phone__home-bar {
  position: absolute;
  bottom: 8px;
  left: 50%;
  z-index: 2;
  width: 34%;
  height: 4px;
  transform: translateX(-50%);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

/* ── Archive page head ── */
.crmeb-hub-page-head {
  padding: 40px 0 24px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.crmeb-hub-page-head__title {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 800;
}
.crmeb-hub-page-head__sub {
  margin: 0;
  color: var(--c-text-muted);
  font-size: 0.9375rem;
}
.crmeb-hub-archive { padding: 32px 0 64px; }

/* ── Breadcrumb ── */
.crmeb-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 24px 0 8px;
  font-size: 0.8125rem;
  color: var(--c-text-muted);
}
.crmeb-breadcrumb a {
  color: var(--c-text-secondary);
  text-decoration: none;
}
.crmeb-breadcrumb a:hover { color: var(--c-primary); }
.crmeb-breadcrumb [aria-current="page"] {
  color: var(--c-text);
  font-weight: 500;
}

/* ── Detail page ── */
.crmeb-hub-detail { padding-bottom: 64px; }
.crmeb-hub-detail__layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}
.crmeb-hub-detail__header h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.crmeb-hub-detail__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.crmeb-hub-detail__showcase {
  margin-bottom: 40px;
}
.crmeb-hub-detail__showcase-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid var(--c-border);
  background: linear-gradient(160deg, #eef2ff, #f8fafc);
  transition: box-shadow var(--transition);
}
.crmeb-hub-detail__showcase-media:hover {
  box-shadow: var(--shadow-md);
}
.crmeb-hub-detail__showcase-media .crmeb-hub-card__media {
  min-height: 240px;
  max-height: 420px;
}

.crmeb-hub-detail__gallery { margin-bottom: 48px; }

/* ── Page preview gallery ── */
.crmeb-hub-gallery {
  padding: 28px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(124, 58, 237, 0.06), transparent 55%),
    var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-card);
}
.crmeb-hub-gallery__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.crmeb-hub-gallery__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.crmeb-hub-gallery__head .crmeb-hub-section__title {
  margin: 0;
}
.crmeb-hub-gallery__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-primary);
  background: var(--c-primary-soft);
  border: 1px solid rgba(37, 99, 235, 0.12);
}
.crmeb-hub-gallery__head .crmeb-hub-section__sub {
  margin: 0;
}
.crmeb-hub-gallery__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.crmeb-hub-gallery__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-full);
  background: var(--c-surface);
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.crmeb-hub-gallery__nav:hover:not(:disabled) {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}
.crmeb-hub-gallery__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.crmeb-hub-gallery__viewport {
  position: relative;
  margin: 0 -8px;
  padding: 0 8px;
}
.crmeb-hub-gallery__viewport::before,
.crmeb-hub-gallery__viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  z-index: 2;
  pointer-events: none;
}
.crmeb-hub-gallery__viewport::before {
  left: 0;
  background: linear-gradient(90deg, var(--c-surface) 20%, transparent);
}
.crmeb-hub-gallery__viewport::after {
  right: 0;
  background: linear-gradient(270deg, var(--c-surface) 20%, transparent);
}
.crmeb-hub-gallery__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 8px;
  padding: 8px 4px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}
.crmeb-hub-gallery__track::-webkit-scrollbar {
  height: 6px;
}
.crmeb-hub-gallery__track::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: var(--radius-full);
}
.crmeb-hub-gallery__card {
  flex: 0 0 auto;
  width: min(200px, 42vw);
  margin: 0;
  scroll-snap-align: start;
}
.crmeb-hub-gallery__card:focus-within .crmeb-hub-gallery__device {
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.14);
}
.crmeb-hub-gallery__device {
  position: relative;
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition);
  cursor: zoom-in;
}
.crmeb-hub-gallery__card:hover .crmeb-hub-gallery__device {
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.14);
}
.crmeb-hub-gallery__tap-hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.42);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.crmeb-hub-gallery__device:hover .crmeb-hub-gallery__tap-hint {
  opacity: 1;
}
.crmeb-hub-gallery__device:has(.crmeb-phone__scroll.is-scrolling) .crmeb-hub-gallery__tap-hint,
.crmeb-hub-gallery__device:has(.crmeb-phone__scroll.is-interacting) .crmeb-hub-gallery__tap-hint {
  opacity: 0;
}
.crmeb-hub-gallery__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 14px;
  text-align: center;
}
.crmeb-hub-gallery__caption strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-text);
}
.crmeb-hub-gallery__caption span {
  font-size: 0.75rem;
  color: var(--c-text-muted);
}

.crmeb-hub-prose {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--c-text-secondary);
}
.crmeb-hub-prose p { margin: 0 0 12px; }

/* Aside sticky card */
.crmeb-hub-aside-card {
  padding: 24px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.crmeb-hub-aside-card--sticky {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}
.crmeb-hub-aside-card__title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
}
.crmeb-hub-aside-steps {
  margin: 0 0 16px;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--c-text-secondary);
  line-height: 1.7;
}
.crmeb-hub-aside-steps li { margin-bottom: 6px; }
.crmeb-hub-aside-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 0.8125rem;
  color: var(--c-warn);
  background: #fffbeb;
  border-radius: var(--radius-sm);
  border: 1px solid #fde68a;
}
.crmeb-hub-aside-meta {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border-light);
}
.crmeb-hub-aside-meta div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}
.crmeb-hub-aside-meta span { color: var(--c-text-muted); }
.crmeb-hub-aside-meta strong { color: var(--c-text); }

/* ── Lightbox ── */
.crmeb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
}
.crmeb-lightbox[hidden] { display: none !important; }
.crmeb-lightbox__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.crmeb-lightbox__canvas.is-dragging {
  cursor: grabbing;
}
.crmeb-lightbox__chrome {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.crmeb-lightbox__chrome > * {
  pointer-events: auto;
}
.crmeb-lightbox__img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: auto;
  will-change: transform, width;
}
.crmeb-lightbox__footer {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding: 10px 20px 18px;
  pointer-events: none;
}
.crmeb-lightbox__footer > * {
  pointer-events: auto;
}
.crmeb-lightbox__toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}
.crmeb-lightbox__zoom-btn,
.crmeb-lightbox__zoom-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}
.crmeb-lightbox__zoom-reset {
  font-size: 0.75rem;
  padding: 0 12px;
}
.crmeb-lightbox__zoom-btn:hover,
.crmeb-lightbox__zoom-reset:hover {
  background: rgba(255, 255, 255, 0.26);
}
.crmeb-lightbox__zoom-level {
  min-width: 52px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.crmeb-lightbox__meta {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.82);
}
.crmeb-lightbox__hint {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}
.crmeb-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.crmeb-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.05);
}
body.admin-bar .crmeb-lightbox__close {
  top: 48px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .crmeb-lightbox__close {
    top: 58px;
  }
}
.crmeb-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition);
}
.crmeb-lightbox__nav:hover { background: rgba(255, 255, 255, 0.26); }
.crmeb-lightbox__nav--prev { left: 20px; }
.crmeb-lightbox__nav--next { right: 20px; }
.crmeb-lightbox__nav[hidden] { display: none !important; }

/* ── Empty states ── */
.crmeb-hub-empty,
.crmeb-hub-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--c-text-muted);
}
.crmeb-hub-empty-state p {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--c-text-secondary);
}
.crmeb-hub-empty-state span { font-size: 0.875rem; }

.crmeb-hub-pagination {
  margin: 40px 0 0;
  text-align: center;
}
.crmeb-hub-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.crmeb-hub-pagination a,
.crmeb-hub-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--c-text-secondary);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
}
.crmeb-hub-pagination a:hover {
  color: var(--c-primary);
  border-color: var(--c-primary);
}
.crmeb-hub-pagination .current {
  color: #fff;
  background: var(--c-primary);
  border-color: var(--c-primary);
}

/* ── Footer ── */
.crmeb-hub-footer {
  margin-top: auto;
  padding: 48px 0 0;
  background: var(--c-text);
  color: #94a3b8;
}
.crmeb-hub-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
.crmeb-hub-footer__brand strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1rem;
  color: #fff;
}
.crmeb-hub-footer__brand p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 360px;
}
.crmeb-hub-footer__links h4 {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.crmeb-hub-footer__links a {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  color: #94a3b8;
  text-decoration: none;
}
.crmeb-hub-footer__links a:hover { color: #fff; }
.crmeb-hub-footer__hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
}
.crmeb-hub-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 0;
  font-size: 0.8125rem;
  border-top: 1px solid #334155;
}
.crmeb-hub-footer__powered { color: #64748b; }

.crmeb-hub-notice {
  background: #fef3c7;
  color: #92400e;
  padding: 12px 20px;
  text-align: center;
}

/* WP global overrides */
.crmeb-hub-site .crmeb-hub-card__media img,
.crmeb-hub-site .crmeb-phone__screen img,
.crmeb-hub-site .crmeb-phone__scroll img {
  contain-intrinsic-size: auto !important;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .crmeb-hub-detail__layout {
    grid-template-columns: 1fr;
  }
  .crmeb-hub-aside-card--sticky {
    position: static;
  }
  .crmeb-hub-detail__main { order: 1; }
  .crmeb-hub-detail__aside { order: 2; }
  .crmeb-hub-steps__list {
    grid-template-columns: 1fr;
  }
  .crmeb-hub-footer__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .crmeb-hub-nav-toggle { display: flex; }
  .crmeb-hub-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 12px 20px 20px;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
  }
  .crmeb-hub-nav.is-open { display: flex; }
  .crmeb-hub-nav a { width: 100%; }
  .crmeb-hub-header { position: relative; }
  .crmeb-hub-header__inner { position: relative; }

  .crmeb-hub-hero { padding: 48px 0 40px; }
  .crmeb-hub-stats { gap: 20px; padding: 16px 20px; }
  .crmeb-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  :root { --card-media-h: 220px; }
  .crmeb-hub-gallery {
    padding: 20px 16px;
  }
  .crmeb-hub-gallery__head {
    flex-direction: column;
    gap: 16px;
  }
  .crmeb-hub-gallery__actions {
    align-self: flex-end;
  }
  .crmeb-hub-gallery__card {
    width: min(180px, 56vw);
  }
  .crmeb-lightbox__nav {
    width: 40px;
    height: 40px;
  }
  .crmeb-lightbox__nav--prev { left: 8px; }
  .crmeb-lightbox__nav--next { right: 8px; }
}

@media (max-width: 480px) {
  .crmeb-hub-grid { grid-template-columns: 1fr; }
  .crmeb-hub-gallery__actions { display: none; }
  .crmeb-hub-gallery__card { width: min(168px, 72vw); }
}
