:root {
  --primary: #536de6;
  --primary-soft: rgba(83, 109, 230, 0.12);
  --accent: #a97efd;
  --text: #2c2f36;
  --muted: #6c757d;
  --border: #e8ebf0;
  --bg: #f5f6f8;
  --card-radius: 10px;
  --header-h: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: min(1350px, calc(100% - 24px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

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

.logo-wrapper {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 44px;
  width: auto;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.header-slogan {
  flex: 1;
  min-width: 0;
  margin: 0 8px;
  padding: 6px 14px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  color: #fff;
  background: #e53935;
  border: 2px solid #ffd700;
  border-radius: 6px;
  box-shadow: 0 0 0 1px #ffec8b inset, 0 2px 6px rgba(229, 57, 53, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .header-slogan {
    font-size: 12px;
    padding: 4px 8px;
  }
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.action-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.action-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff !important;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
}

.login-btn:hover {
  filter: brightness(1.05);
}

/* Dynamic bar */
.dynamic-bar {
  margin-top: 12px;
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.dynamic-badge {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dynamic-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.dynamic-text {
  display: inline-block;
  animation: marquee 28s linear infinite;
  font-size: 14px;
  color: #445;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Filters */
.section-cat-navbtn {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 14px;
}

.section-cat-navbtn .btn {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.section-cat-navbtn .btn:hover,
.section-cat-navbtn .btn.active {
  background: #ffe566;
  border-color: #f0d23a;
  font-weight: 700;
}

/* Cards grid */
.posts-warp {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding-bottom: 40px;
}

@media (min-width: 768px) {
  .posts-warp {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .posts-warp {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .posts-warp {
    grid-template-columns: repeat(5, 1fr);
  }
}

.post-item {
  position: relative;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #111;
  aspect-ratio: 3 / 4;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.post-item-clickable {
  cursor: pointer;
}

.post-item .media-img,
.post-item .media-video,
.post-item .media-audio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.post-item .media-img {
  background-size: cover;
  background-position: center;
  background-color: transparent;
  transition: transform 0.35s ease;
}

.post-item .media-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.post-item .media-audio {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.media-audio-icon {
  font-size: 42px;
  color: rgba(255, 255, 255, 0.85);
}

.media-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-item:hover .media-img,
.post-item:hover .media-video video {
  transform: scale(1.04);
}

.post-item .entry-wrapper {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 48px 10px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  color: #fff;
  pointer-events: none;
}

.entry-cat-dot {
  font-size: 12px;
  opacity: 0.95;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.entry-cat-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  display: inline-block;
}

.entry-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.28);
  margin: 0 -10px -10px;
  padding: 8px 10px;
}

.entry-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.entry-meta .meta-price {
  margin-left: auto;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  background: #fff;
  border-radius: 12px;
  border: 1px dashed var(--border);
}

/* Side rollbar */
.rollbar {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  width: 56px;
}

.rollbar ul {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rollbar li + li {
  border-top: 1px solid #eee;
}

.rollbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  font-size: 12px;
  line-height: 1.25;
  color: #333;
  transition: background 0.2s, color 0.2s;
}

.rollbar a span {
  display: block;
  width: 2em;
  text-align: center;
  word-break: break-all;
}

.rollbar a:hover {
  background: #f7f8fa;
  color: var(--primary);
}

.rollbar i {
  font-size: 18px;
}

@media (max-width: 900px) {
  .rollbar {
    right: 8px;
    width: 52px;
  }

  .rollbar a {
    padding: 10px 4px;
    font-size: 11px;
  }
}

/* Footer */
.site-footer {
  background: #111;
  color: #999;
  text-align: center;
  padding: 28px 16px;
  font-size: 12px;
  line-height: 1.8;
  margin-top: 20px;
}

.site-footer a {
  color: #ccc;
}

/* Busy modal */
.busy-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.busy-modal.show {
  display: flex;
}

.busy-modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 24px 20px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.busy-modal-card p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
}

.busy-modal-card button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 14px;
  cursor: pointer;
}

.gate-hint {
  display: none;
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 80;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  pointer-events: none;
}

/* Image preview modal - fullscreen */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: none;
}

.preview-modal.show {
  display: block;
}

.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: #000;
}

.preview-modal-panel {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

.preview-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.preview-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

.preview-image-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.preview-image-wrap img,
.preview-image-wrap video,
.preview-image-wrap audio,
.preview-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 还没拿到真实地址时不显示，避免出现左上角那个裂图小图标 */
.preview-image-wrap img:not([src]),
.preview-image-wrap img[src=""] {
  visibility: hidden;
}

.preview-media.preview-image {
  opacity: 0;
  transition: opacity 0.18s ease;
}

.preview-media.preview-image.is-ready {
  opacity: 1;
}

.preview-audio-shell {
  width: min(92vw, 560px);
  padding: 28px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.preview-audio-icon {
  font-size: 56px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 18px;
}

.preview-audio-shell .preview-audio {
  width: 100%;
  height: auto;
}

.preview-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 72px 20px max(24px, env(safe-area-inset-bottom));
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.62) 55%, transparent 100%);
}

.preview-region {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 8px;
}

.preview-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
}

.preview-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  white-space: pre-wrap;
  max-height: 28vh;
  overflow: auto;
}

@media (max-width: 640px) {
  .preview-title {
    font-size: 18px;
  }

  .preview-desc {
    font-size: 14px;
    max-height: 22vh;
  }
}

.preview-media-error {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  padding: 0 24px;
}
