/* App 底栏 + 专题/发现共用表面 */

body.has-tabbar {
  padding-bottom: calc(var(--app-tabbar-h, 64px) + env(safe-area-inset-bottom, 0px) + 10px);
}

@media (min-width: 1024px) {
  body.has-tabbar {
    padding-bottom: 0;
  }

  .bottom-tabbar {
    display: none !important;
  }
}

.bottom-tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: 58px;
  padding: 4px 6px;
  border-radius: 22px;
  background: var(--app-glass, rgba(18, 18, 24, 0.82));
  border: 1px solid var(--app-glass-border, rgba(255, 255, 255, 0.1));
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.bottom-tabbar .tab-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 56px;
  border-radius: 16px;
  background: var(--app-accent-soft, rgba(255, 45, 120, 0.16));
  pointer-events: none;
  z-index: 0;
  transform: translateX(6px);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), width 280ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, width;
}

.bottom-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--app-text-muted, #6e6e80);
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 500;
  min-width: 0;
  padding: 4px 2px;
  border-radius: 16px;
  position: relative;
  z-index: 1;
  transition:
    color 180ms var(--app-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    transform 140ms var(--app-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.bottom-tabbar a:active {
  transform: scale(0.92);
}

.bottom-tabbar a.active {
  color: var(--app-accent, #ff2d78);
  font-weight: 700;
  background: transparent;
}

.bottom-tabbar a.active::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--app-accent, #ff2d78);
  box-shadow: 0 0 8px var(--app-accent, #ff2d78);
}

/* 底栏切页：整页左右滑（底栏固定不动） */
html.tab-slide-lock {
  overflow-x: hidden;
}

body.tab-exit-left > *:not(.bottom-tabbar):not(script):not(style) {
  animation: tabPageOutLeft 220ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

body.tab-exit-right > *:not(.bottom-tabbar):not(script):not(style) {
  animation: tabPageOutRight 220ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

body.tab-enter-right > *:not(.bottom-tabbar):not(script):not(style) {
  animation: tabPageInFromRight 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.tab-enter-left > *:not(.bottom-tabbar):not(script):not(style) {
  animation: tabPageInFromLeft 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes tabPageOutLeft {
  to {
    opacity: 0.35;
    transform: translate3d(-18%, 0, 0);
  }
}

@keyframes tabPageOutRight {
  to {
    opacity: 0.35;
    transform: translate3d(18%, 0, 0);
  }
}

@keyframes tabPageInFromRight {
  from {
    opacity: 0.2;
    transform: translate3d(22%, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes tabPageInFromLeft {
  from {
    opacity: 0.2;
    transform: translate3d(-22%, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bottom-tabbar .tab-indicator {
    transition: none;
  }

  body.tab-exit-left > *:not(.bottom-tabbar),
  body.tab-exit-right > *:not(.bottom-tabbar),
  body.tab-enter-right > *:not(.bottom-tabbar),
  body.tab-enter-left > *:not(.bottom-tabbar) {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.bottom-tabbar a.disabled-tab {
  opacity: 0.45;
}

.bottom-tabbar svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 280ms var(--app-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.bottom-tabbar a.active svg {
  stroke: var(--app-accent, #ff2d78);
  transform: scale(1.12);
  animation: tabPop 420ms var(--app-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

@keyframes tabPop {
  0% {
    transform: scale(0.86);
  }
  55% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1.12);
  }
}

.page-section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 12px;
  padding: 0 4px;
}

.page-section-title h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--app-text);
  font-family: var(--app-font-display, inherit);
}

.page-section-title span {
  color: var(--app-text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.discover-page .home-portal {
  padding-top: 8px;
}

.discover-page .site-header.compact + .content-wrap {
  padding-top: 12px;
}

.site-header.compact .brand-logo-sm {
  border-radius: 8px;
  object-fit: contain;
}

.header-shell-with-theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}

.header-shell-with-theme .xj-theme-toggle {
  flex-shrink: 0;
}

/* 专题合集 */
.album-hero {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 45, 120, 0.18), transparent 55%),
    radial-gradient(100% 70% at 100% 0%, rgba(245, 197, 24, 0.12), transparent 50%),
    var(--app-surface);
  border-radius: var(--app-radius-lg);
  padding: 22px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--app-border);
}

.album-hero h1 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  color: var(--app-text);
  font-family: var(--app-font-display);
}

.album-hero-sub {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--app-accent);
}

.album-hero-desc,
.album-hero-count {
  margin: 0 0 6px;
  color: var(--app-text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 14px;
}

.album-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--app-surface);
  border-radius: var(--app-radius);
  overflow: hidden;
  border: 1px solid var(--app-border);
  box-shadow: var(--app-shadow-sm);
}

.album-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--app-surface-2);
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-no-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--app-text-muted);
  font-size: 0.9rem;
}

.album-disc-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.album-title {
  margin: 10px 12px 4px;
  font-size: 0.9rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--app-text);
}

.album-desc {
  margin: 0 12px 12px;
  font-size: 0.75rem;
  color: var(--app-text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.album-loading,
.album-empty {
  color: var(--app-text-muted);
  padding: 24px 8px;
  text-align: center;
}

.album-detail-hero {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  background: var(--app-surface);
  border-radius: var(--app-radius-lg);
  padding: 16px;
  border: 1px solid var(--app-border);
}

.album-detail-cover {
  width: 140px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.album-detail-text h1 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--app-text);
}

.album-detail-meta {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--app-gold);
}

.album-detail-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--app-text-secondary);
  line-height: 1.55;
}

.topic-block {
  background: var(--app-surface);
  border-radius: var(--app-radius);
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--app-border);
}

.topic-block h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--app-text);
}

.h-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.h-scroll::-webkit-scrollbar {
  display: none;
}

.h-scroll .mini-card {
  flex: 0 0 140px;
  cursor: pointer;
}

.h-scroll .mini-card .thumb {
  aspect-ratio: 16/10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--app-surface-2);
}

.h-scroll .mini-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.h-scroll .mini-card p {
  margin: 6px 0 0;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--app-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.placeholder-page {
  text-align: center;
  padding: 64px 20px 100px;
  color: var(--app-text-muted);
}

.placeholder-page h2 {
  margin: 0 0 8px;
  color: var(--app-text);
  font-family: var(--app-font-display);
}
