/* Content site UI — unified visual system & interaction polish */
:root {
  --bg: #0c0d10;
  --bg-elev: #14161c;
  --bg-card: #1a1d26;
  --bg-card-hover: #222632;
  --line: #2a2f3a;
  --line-strong: #3b4252;
  --text: #f3f4f6;
  --text-2: #9ca3af;
  --text-3: #6b7280;
  --brand: #ff4d6d;
  --brand-2: #ff7a93;
  --brand-soft: rgba(255, 77, 109, 0.14);
  --brand-ring: rgba(255, 77, 109, 0.45);
  --ok: #34d399;
  --err: #f87171;
  --warn: #fbbf24;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.22);
  --nav-h: 52px;
  --max: 1440px;
  --font: "PingFang SC", "SF Pro Text", "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.18s;
  --dur-slow: 0.28s;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: var(--fs-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; color: inherit; }
button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 6px;
}
::selection { background: rgba(255, 77, 109, 0.28); }

/* Unified focus ring */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Icons ---------- */
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 36px; height: 36px; }
.meta-icon {
  width: 13px;
  height: 13px;
  opacity: 0.85;
}

/* ---------- Top bar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: rgba(12, 13, 16, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 8px;
  transition: opacity var(--dur) var(--ease);
}
.logo:hover { opacity: 0.9; }
.logo:active { opacity: 0.8; }
.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #ff8fa3);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: var(--fs-sm);
  color: #fff;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(255, 77, 109, 0.25);
}
.logo-text strong {
  display: block;
  font-size: 15px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.logo-text span {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.2;
}

.cats {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  padding: 2px 0;
}
.cats::-webkit-scrollbar { display: none; }
.cat-btn {
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.cat-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.cat-btn:active { transform: scale(0.97); }
.cat-btn.active {
  color: var(--brand-2);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.22);
}

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

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  pointer-events: none;
  transition: color var(--dur) var(--ease);
}
.search-wrap:focus-within .search-icon { color: var(--brand-2); }
.search {
  width: 220px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 12px 7px 34px;
  outline: none;
  font-size: var(--fs-md);
  color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.search::placeholder { color: var(--text-3); }
.search:hover { border-color: var(--line-strong); }
.search:focus {
  border-color: var(--brand-ring);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: var(--bg-card);
}

/* Icon + text buttons */
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--bg-card);
}
.icon-btn:active { transform: scale(0.97); }
.icon-btn.is-spinning .icon {
  animation: spin 0.8s linear infinite;
}
.icon-btn-ghost {
  border-color: transparent;
  background: transparent;
  padding: 8px;
  border-radius: 10px;
}
.icon-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: transparent;
}

/* Coarse-pointer devices: guarantee >= 44px effective tap area without visual growth */
@media (pointer: coarse) {
  .icon-btn::after,
  .cat-btn::after,
  .back-btn::after,
  .status-retry::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: max(100%, 44px);
    height: max(100%, 44px);
    transform: translate(-50%, -50%);
  }
  .cat-btn,
  .back-btn,
  .status-retry { position: relative; }
}

/* ---------- Layout ---------- */
.main {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 36px;
  flex: 1;
}

.page { display: none; }
.page.active {
  display: block;
  animation: page-in var(--dur-slow) var(--ease);
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}
.section-head > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.section-head h2 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: 0.01em;
}
.section-head p {
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.feed-status {
  margin-top: 0 !important;
  font-size: var(--fs-sm) !important;
  color: var(--text-3);
  transition: color var(--dur) var(--ease);
}
.feed-status.is-loading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.feed-status.is-loading::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px var(--brand-soft);
  animation: status-pulse 1.2s ease-in-out infinite;
}
.feed-status.is-error { color: var(--err) !important; }
.feed-status.is-loading { color: var(--brand-2) !important; }
@keyframes status-pulse {
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ---------- Featured ---------- */
.featured {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.feature-main,
.feature-side-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  border: 1px solid var(--line);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur-slow) var(--ease);
}
.feature-main:hover,
.feature-side-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.feature-main:focus-visible,
.feature-side-item:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}
.feature-main { min-height: 250px; }
.feature-side { display: grid; gap: 10px; }
.feature-side-item { min-height: 120px; }
.skeleton-block {
  border-color: transparent;
  background: linear-gradient(90deg, #1a1d26 25%, #242836 50%, #1a1d26 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease infinite;
  cursor: default;
}
.feature-main img,
.feature-side-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.feature-main:hover img,
.feature-side-item:hover img { transform: scale(1.04); }
.feature-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent 28%, rgba(0, 0, 0, 0.88) 100%);
  pointer-events: none;
}
.feature-body {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px;
}
.feature-body .tag {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: #fff;
  background: var(--brand);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.feature-body h3 {
  margin: 0;
  font-size: 18px;
  font-weight: var(--fw-bold);
  line-height: 1.3;
}
.feature-side-item .feature-body h3 { font-size: 15px; }
.feature-body .meta {
  margin-top: 6px;
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.feature-body .meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Cover images fade in over the placeholder once decoded (compositor-only) */
.fade-media {
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease);
}
.fade-media.is-loaded { opacity: 1; }

/* ---------- Post grid ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.post-grid.is-loading { display: block; }
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.post-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
}
.post-card:active { transform: translateY(-1px); }
.post-card:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 2px;
}
.cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0b0e;
  overflow: hidden;
}
.media-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-3);
  background: linear-gradient(135deg, #1b1e27, #111318);
  font-size: var(--fs-sm);
}
.media-fallback .icon {
  width: 24px;
  height: 24px;
  opacity: 0.7;
}
.media-fallback.is-compact span { font-size: var(--fs-xs); }
.media-fallback.is-compact .icon {
  width: 20px;
  height: 20px;
}
.cover img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease), opacity 0.3s var(--ease);
}
.post-card:hover .cover img { transform: scale(1.05); }
.cover .play {
  position: absolute;
  z-index: 3;
  right: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  color: #fff;
  backdrop-filter: blur(6px);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.cover .play .icon {
  width: 12px;
  height: 12px;
  margin-left: 1px;
}
.post-card:hover .cover .play {
  transform: scale(1.06);
  background: rgba(255, 77, 109, 0.85);
  border-color: transparent;
}
.cover .badge {
  position: absolute;
  z-index: 3;
  left: 8px;
  top: 8px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  backdrop-filter: blur(6px);
  letter-spacing: 0.02em;
}
.card-body { padding: 10px; }
.card-body h3 {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.card-meta {
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.card-meta .author {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta .stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.card-meta .stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ---------- Detail ---------- */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: start;
}
.detail-aside {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: calc(var(--nav-h) + 10px);
}
.player-box {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.player-box .artplayer-host,
.player-box .art-video-player,
.player-box .art-video {
  width: 100%;
  height: 100%;
  display: block;
  max-height: 70vh;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: contain;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

.player-box .artplayer-host {
  min-height: min(70vh, 720px);
}

@media (max-width: 720px) {
  .player-box .artplayer-host { min-height: auto; aspect-ratio: 16 / 9; }
}
.media-interaction-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  max-width: calc(100% - 28px);
  padding: 8px 11px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -40%);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.media-interaction-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}
.loading-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  z-index: 2;
}
.player-box.loading .loading-overlay { display: flex; }

/* Buffering indicator — shown while the stream stalls mid-play */
.player-box::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.player-box.is-buffering:not(.loading)::after {
  opacity: 1;
  animation: spin 0.7s linear infinite;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.detail-card {
  margin-top: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.detail-card h1 {
  margin: 0 0 8px;
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: 1.35;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--text-2);
  font-size: var(--fs-md);
  margin-bottom: 10px;
}
.detail-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.detail-meta .meta-item .meta-icon {
  color: var(--text-3);
}
.detail-content {
  color: var(--text-2);
  font-size: var(--fs-base);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.chip {
  font-size: var(--fs-sm);
  color: var(--brand-2);
  background: var(--brand-soft);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-weight: var(--fw-medium);
}

.side-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.side-card h3 {
  margin: 0 0 8px;
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.side-card h3 .icon { color: var(--brand-2); }

.related-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 8px;
  padding: 7px;
  margin: 0 -7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.related-item + .related-item {
  border-top: 1px solid transparent;
}
.related-item:hover { background: rgba(255, 255, 255, 0.04); }
.related-item:focus-visible {
  outline: 2px solid var(--brand-ring);
  outline-offset: 0;
}
.related-item img,
.related-thumb {
  width: 84px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #0a0b0e;
}
.related-item .t {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.related-item .m {
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.video-item {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font-size: var(--fs-md);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.video-item .video-item-title {
  font-weight: var(--fw-semibold);
  display: flex;
  align-items: center;
  gap: 6px;
}
.video-item .video-item-sub {
  font-size: var(--fs-xs);
  opacity: 0.7;
  margin-top: 4px;
  word-break: break-all;
  line-height: 1.4;
}
.video-item:hover {
  border-color: var(--brand-ring);
  color: var(--text);
  background: var(--brand-soft);
}
.video-item.active {
  border-color: var(--brand-ring);
  color: var(--text);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.12);
}

/* ---------- Empty / status ---------- */
.empty {
  text-align: center;
  color: var(--text-3);
  padding: 56px 16px;
  font-size: var(--fs-base);
}
.empty-icon {
  margin: 0 auto 12px;
  color: var(--text-3);
  opacity: 0.7;
}
.empty-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-2);
  margin-bottom: 6px;
}
.empty-desc {
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.empty.compact {
  padding: 16px 8px;
}
.empty.compact .empty-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
}
.empty.compact .empty-title {
  font-size: var(--fs-md);
}
.empty-retry { margin-top: 14px; }

.status-bar {
  margin-top: 8px;
  font-size: var(--fs-sm);
  color: var(--text-3);
  min-height: 1.2em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-bar.ok { color: var(--ok); }
.status-bar.err { color: var(--err); }
.status-retry {
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: var(--err);
  background: rgba(248, 113, 113, 0.08);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.status-retry:hover {
  background: rgba(248, 113, 113, 0.18);
  color: #fff;
}
.status-retry:active { transform: scale(0.95); }

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: filter var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn:hover {
  border-color: var(--line-strong);
  background: var(--bg-card);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 77, 109, 0.22);
}
.btn-primary:hover {
  filter: brightness(1.06);
  border-color: var(--brand);
  background: var(--brand);
}
.btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  padding: 6px 8px 6px 2px;
  margin: 0 0 6px -2px;
  border-radius: 8px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.back-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease);
}
.modal-mask.show {
  display: flex;
  opacity: 1;
  animation: mask-in var(--dur-slow) var(--ease);
}
@keyframes mask-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  width: min(440px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  animation: modal-in var(--dur-slow) var(--ease);
}
.modal-lg { width: min(540px, 100%); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.modal-head h3 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}
.modal-desc {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.55;
}
.field-label {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-bottom: 6px;
  font-weight: var(--fw-medium);
}
.field-input,
.field-textarea {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  outline: none;
  margin-bottom: 10px;
  color: inherit;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field-input:hover,
.field-textarea:hover { border-color: var(--line-strong); }
.field-input:focus,
.field-textarea:focus {
  border-color: var(--brand-ring);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ---------- Global loading ---------- */
.global-loading-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 9, 12, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease), visibility var(--dur-slow) var(--ease);
}
.global-loading-mask.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.global-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text);
  text-align: center;
}
.global-loading-content strong {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}
.global-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--brand);
  border-right-color: var(--brand-2);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(255, 77, 109, 0.18);
  animation: spin 0.8s linear infinite;
}

/* ---------- Toast ---------- */
.toast-host {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 28px));
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1f2937;
  color: #fff;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: var(--fs-md);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: toast-in 0.25s var(--ease);
  pointer-events: auto;
}
.toast.is-leaving {
  animation: toast-out 0.2s var(--ease) forwards;
}
.toast.ok { border-color: rgba(52, 211, 153, 0.35); }
.toast.err { border-color: rgba(248, 113, 113, 0.4); }
.toast .icon { flex-shrink: 0; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(0.98); }
}

/* ---------- Gallery ---------- */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}
.image-gallery a {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0b0e;
  aspect-ratio: 1;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.image-gallery a:hover {
  border-color: var(--line-strong);
  transform: scale(1.01);
}
.image-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.image-gallery a:hover img { transform: scale(1.04); }

/* ---------- Skeleton ---------- */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.skeleton-cover {
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, #1a1d26 25%, #242836 50%, #1a1d26 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease infinite;
}
.skeleton-lines { padding: 10px; }
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #1a1d26 25%, #242836 50%, #1a1d26 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease infinite;
  margin-bottom: 8px;
}
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w50 { width: 50%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-sm);
  text-align: center;
  padding: 14px 12px calc(20px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Back to top ---------- */
.back-top {
  position: fixed;
  right: 16px;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
    visibility var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.back-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.back-top:hover {
  color: var(--text);
  border-color: var(--brand-ring);
}
.back-top:active { transform: scale(0.94); }
.back-top .icon { width: 20px; height: 20px; }

/* Long-press 2x speed indicator on the player */
.player-box.is-long-press-speeding {
  box-shadow: 0 0 0 2px var(--brand-ring), var(--shadow);
}

/* ---------- Recent strip (if used) ---------- */
.recent-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
  scrollbar-width: thin;
}
.recent-chip {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 56px 120px;
  gap: 8px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  min-width: 190px;
  transition: border-color var(--dur) var(--ease);
}
.recent-chip:hover { border-color: var(--line-strong); }
.recent-chip img {
  width: 56px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  background: #0a0b0e;
}
.recent-chip .t {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .main { width: min(var(--max), calc(100% - 24px)); }
  .post-grid,
  .skeleton-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feature-main { min-height: 230px; }
  .feature-side-item { min-height: 110px; }
}
@media (max-width: 960px) {
  .feature-main { min-height: 220px; }
  .feature-side-item { min-height: 105px; }
  .post-grid,
  .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-aside { position: static; }
  .search { width: 160px; }
}
@media (max-width: 700px) {
  .image-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .nav {
    display: grid;
    grid-template-columns: auto minmax(80px, 1fr) auto;
    grid-template-rows: 34px 34px;
    height: auto;
    min-height: var(--nav-h);
    gap: 6px 8px;
    padding: 6px 8px;
  }
  .logo { grid-column: 1; grid-row: 1; }
  .nav-actions {
    grid-column: 3;
    grid-row: 1;
    justify-content: flex-end;
    gap: 4px;
  }
  .cats {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    padding: 0;
  }
  .search-wrap {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  .search {
    width: 100%;
    height: 32px;
    padding: 6px 8px 6px 29px;
  }
  .search-icon { left: 9px; }
  .logo-text span { display: none; }
  .logo-text strong { font-size: var(--fs-md); }
  .btn-label { display: none; }
  .icon-btn {
    padding: 7px;
    min-width: 32px;
    min-height: 32px;
  }
  .cat-btn { padding: 5px 9px; }
  .main {
    width: calc(100% - 16px);
    padding-top: 10px;
  }
  .section-head { margin-bottom: 8px; }
  .section-head > div { gap: 4px 8px; }
  #listHint { display: none; }
  .featured {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 6px;
    margin-bottom: 10px;
  }
  .feature-main { min-height: 210px; }
  .feature-side { gap: 6px; }
  .feature-side-item { min-height: 102px; }
  .feature-body { padding: 9px; }
  .feature-side-item .feature-body { padding: 8px; }
  .feature-side-item .feature-body h3 { font-size: var(--fs-md); }
  .feature-side-item .feature-body .meta { display: none; }
  .feature-body h3 { font-size: 15px; }
  .feature-body .tag { padding: 2px 6px; margin-bottom: 4px; }
  .post-grid,
  .skeleton-grid { grid-template-columns: 1fr; gap: 8px; }
  .post-card,
  .skeleton-card {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    min-height: 112px;
  }
  .post-card .cover,
  .skeleton-cover {
    aspect-ratio: auto;
    min-height: 112px;
    height: 100%;
  }
  .card-body { padding: 9px 10px; }
  .card-body h3 { font-size: var(--fs-md); }
  .card-meta { align-items: flex-end; }
  .card-meta .author { max-width: 55%; }
  .cover .badge { left: 6px; top: 6px; padding: 2px 6px; }
  .cover .play { right: 6px; bottom: 6px; width: 28px; height: 28px; }
  .skeleton-lines { padding: 10px; }
  .image-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-card { padding: 12px; }
  .detail-card h1 { font-size: 18px; }
  .modal-actions { justify-content: stretch; }
  .modal-actions .btn { flex: 1; }
}

@media (max-width: 360px) {
  .logo-text { display: none; }
  .post-card,
  .skeleton-card { grid-template-columns: 112px minmax(0, 1fr); }
}

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

/* Ensure attribute-hidden wins over component display rules */
[hidden] { display: none !important; }

/* Soft body scroll lock when modal open (optional class) */
body.modal-open,
body.global-loading-open { overflow: hidden; }

/* 🔓 解锁全片按钮（本项目附加） */
.video-item { position: relative; }
.video-item-unlock {
  position: absolute;
  top: 8px;
  right: 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm, 6px);
  background: var(--brand-soft, rgba(255, 77, 109, .14));
  color: var(--brand, #ff4d6d);
  z-index: 2;
}
.video-item-unlock:hover { background: var(--brand-ring, rgba(255, 77, 109, .45)); color: #fff; }

/* 音频附件（本项目附加） */
#audioBox { margin: 14px 0; padding: 14px; border: 1px solid var(--line, #2a2f3a); border-radius: var(--radius, 8px); background: var(--bg-elev, #14161c); }
.audio-head-title { margin: 0 0 8px; font-size: 14px; color: var(--text, #f3f4f6); }
.audio-item { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px dashed var(--line, #2a2f3a); }
.audio-item:last-child { border-bottom: none; }
.audio-title { font-size: 13px; color: var(--text-2, #9ca3af); }
.audio-item audio { width: 100%; }
