:root {
  color-scheme: dark;
  --feed-green: #44d19a;
  --feed-text: #fff;
  --feed-muted: rgba(255, 255, 255, .74);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #050706; }
body { color: var(--feed-text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, a { color: inherit; font: inherit; }
button { padding: 0; border: 0; background: none; }
a { text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.media-feed-shell { position: relative; width: min(100%, 480px); height: 100dvh; min-height: 100%; margin: 0 auto; overflow: hidden; background: #050706; isolation: isolate; }
.media-feed { width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; scroll-snap-type: y mandatory; overscroll-behavior-y: contain; scrollbar-width: none; }
.media-feed::-webkit-scrollbar { display: none; }
.media-feed-slide { position: relative; width: 100%; height: 100%; min-height: 100dvh; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; background: #050706; }
.media-feed-slide[data-feed-loop-clone] { pointer-events: none; }

.media-feed-gallery { position: absolute; inset: 0; z-index: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.media-feed-gallery::-webkit-scrollbar { display: none; }
.media-feed-media { position: relative; flex: 0 0 100%; width: 100%; height: 100%; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; background: #050706; }
.media-feed-backdrop, .media-feed-stage { position: absolute; inset: 0; }
.media-feed-shade { position: absolute; inset: 0; }
.media-feed-backdrop { overflow: hidden; background: radial-gradient(circle at 50% 35%, #27312d 0, #111713 48%, #050706 100%); }
.media-feed-backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(24px) brightness(.56) saturate(.86); opacity: .86; transform: scale(1.14); }
.media-feed-stage { display: grid; place-items: center; background: rgba(0, 0, 0, .12); }
.media-feed-stage > img, .media-feed-stage > video { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; }
.media-feed-stage > video { background: #050706; }
.media-feed-shade { z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.43) 0%, transparent 19%, transparent 48%, rgba(0,0,0,.18) 60%, rgba(0,0,0,.86) 100%); transition: opacity .22s ease; }

.media-feed-topbar { position: absolute; z-index: 20; top: 0; right: 0; left: 0; height: calc(64px + env(safe-area-inset-top)); padding: calc(12px + env(safe-area-inset-top)) 15px 8px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; pointer-events: none; transition: opacity .22s ease, transform .22s ease; }
.media-feed-topbar > * { pointer-events: auto; }
.media-feed-back, .media-feed-active-author { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.19); border-radius: 50%; background: rgba(8,12,10,.34); box-shadow: 0 5px 18px rgba(0,0,0,.18); -webkit-backdrop-filter:blur(11px);backdrop-filter:blur(11px); }
.media-feed-back svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; }
.media-feed-active-author { justify-self: end; overflow: hidden; }
.media-feed-active-author img { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-feed-brand { min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.12; text-shadow: 0 1px 6px rgba(0,0,0,.65); }
.media-feed-brand strong { color: var(--feed-green); font-family: Georgia, "Times New Roman", serif; font-size: 18px; letter-spacing: .04em; }
.media-feed-brand span { margin-top: 3px; color: rgba(255,255,255,.86); font-size: 10px; }

.media-feed-controls-toggle { position: absolute; z-index: 22; right: 11px; bottom: calc(40px + env(safe-area-inset-bottom)); width: 48px; min-width: 46px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 12px; color: #fff; text-shadow: 0 1px 5px rgba(0,0,0,.7); cursor: pointer; transition: color .18s ease, transform .18s ease; }
.media-feed-controls-toggle > span { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.19); border-radius: 50%; background: rgba(249,249,247,.92); color: #333d38; box-shadow: 0 5px 14px rgba(0,0,0,.21); -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px); transition: color .18s ease, background .18s ease, border-color .18s ease; }
.media-feed-controls-toggle .ui-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.media-feed-controls-toggle > em { max-width: 56px; overflow: hidden; color: #fff; font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.media-feed-controls-toggle:active { transform: scale(.96); }
.media-feed-controls-toggle[aria-pressed="true"] > span { border-color: rgba(68,209,154,.58); background: rgba(18,65,49,.9); color: #dffff2; }

.media-feed-swipe-hint { position: absolute; z-index: 20; top: calc(76px + env(safe-area-inset-top)); left: 50%; display: flex; flex-direction: column; align-items: center; color: rgba(255,255,255,.82); font-size: 10px; pointer-events: none; text-shadow: 0 1px 5px rgba(0,0,0,.8); transform: translateX(-50%); transition: opacity .25s ease, transform .25s ease; }
.media-feed-swipe-hint svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; animation: feed-hint 1.5s ease-in-out infinite; }
.media-feed-swipe-hint.is-hidden { opacity: 0; transform: translate(-50%, -8px); }

.media-feed-actions { position: absolute; z-index: 6; right: 11px; bottom: calc(98px + env(safe-area-inset-bottom)); width: 48px; display: flex; flex-direction: column; align-items: center; gap: 13px; transition: opacity .22s ease, transform .22s ease; }
.media-feed-actions > a, .media-feed-actions > button { min-width: 46px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 12px; text-shadow: 0 1px 5px rgba(0,0,0,.7); }
.media-feed-actions > a > span, .media-feed-actions > button > span { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.19); border-radius: 50%; background: rgba(249,249,247,.92); color: #333d38; box-shadow: 0 5px 14px rgba(0,0,0,.21); -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px); }
.media-feed-actions .ui-icon, .media-feed-actions span > svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.media-feed-actions > * > em { max-width: 56px; overflow: hidden; color: #fff; font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.media-feed-actions > [data-feed-like][aria-pressed="true"] > span { color: #e44958; }
.media-feed-actions > [data-feed-like][aria-pressed="true"] .ui-icon { fill: currentColor; }
.media-feed-actions > [data-feed-favorite][aria-pressed="true"] > span { color: #c58a25; }
.media-feed-actions > [data-feed-favorite][aria-pressed="true"] .ui-icon { fill: currentColor; }
.media-feed-actions > .media-feed-author-avatar { width: 45px; height: 45px; min-width: 45px; overflow: hidden; border: 2px solid rgba(255,255,255,.94); border-radius: 50%; aspect-ratio: 1; background: #fff; box-shadow: 0 5px 16px rgba(0,0,0,.28); }
.media-feed-author-avatar img { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; }

.media-feed-copy { position: absolute; z-index: 5; right: 72px; bottom: calc(54px + env(safe-area-inset-bottom)); left: 15px; text-shadow: 0 1px 5px rgba(0,0,0,.72); transition: opacity .22s ease, transform .22s ease; }
.media-feed-tags { margin-bottom: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.media-feed-tags span { padding: 4px 8px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; background: rgba(26,101,75,.66); color: #ddfff2; font-size: 9px; font-weight: 700; -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px); }
.media-feed-title { max-width: 100%; display: flex; align-items: flex-end; gap: 6px; }
.media-feed-title h1 { max-height: 2.45em; margin: 0; overflow: hidden; display: -webkit-box; color: #fff; font-size: 18px; line-height: 1.22; letter-spacing: .015em; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.media-feed-title > span { flex: none; color: rgba(255,255,255,.8); font-size: 22px; line-height: 1; }
.media-feed-copy > p { max-height: 3.2em; margin: 7px 0 8px; overflow: hidden; display: -webkit-box; color: rgba(255,255,255,.82); font-size: 10px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.media-feed-meta { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.72); font-size: 8px; }
.media-feed-meta a { min-width: 0; display: flex; align-items: center; gap: 6px; color: #fff; font-size: 9px; font-weight: 700; }
.media-feed-meta img { width: 22px; height: 22px; object-fit: cover; border: 1px solid rgba(255,255,255,.6); border-radius: 50%; }
.media-feed-location { width: min(100%, 310px); height: 34px; margin-top: 8px; padding: 0 9px; display: flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.14); border-radius: 17px; background: rgba(15,20,17,.42); color: rgba(255,255,255,.9); font-size: 9px; -webkit-backdrop-filter:blur(9px);backdrop-filter:blur(9px); }
.media-feed-location .ui-icon { flex: none; width: 14px; height: 14px; color: var(--feed-green); }
.media-feed-location span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-feed-location b { margin-left: auto; font-size: 15px; }

.media-feed-play { position: absolute; z-index: 4; top: 50%; left: 50%; width: 62px; height: 62px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; background: rgba(5,8,6,.43); opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.92); transition: opacity .18s ease, transform .18s ease; -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px); }
.media-feed-play svg { width: 29px; height: 29px; fill: #fff; stroke: none; transform: translateX(2px); }
.media-feed-media.needs-play .media-feed-play, .media-feed-media.is-paused .media-feed-play { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.media-feed-progress { position: absolute; z-index: 7; right: 12px; bottom: calc(13px + env(safe-area-inset-bottom)); left: 12px; height: 25px; display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.78); font-size: 8px; text-shadow: 0 1px 4px rgba(0,0,0,.75); transition: opacity .22s ease, transform .22s ease; }
.media-feed-progress > span { flex: 1; height: 3px; overflow: hidden; border-radius: 2px; background: rgba(255,255,255,.35); }
.media-feed-progress i { width: 0; height: 100%; display: block; border-radius: inherit; background: #fff; box-shadow: 0 0 5px rgba(255,255,255,.45); }
.media-feed-progress time { flex: none; min-width: 68px; font-variant-numeric: tabular-nums; text-align: right; }
.media-feed-progress > em { min-width: 34px; margin-left: auto; padding: 3px 7px; border-radius: 10px; background: rgba(5,8,6,.42); font-style: normal; font-variant-numeric: tabular-nums; text-align: center; -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px); }
.media-feed-progress [hidden], .media-feed-actions [hidden] { display: none; }

.media-feed-status { position: absolute; z-index: 30; right: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); max-width: calc(100% - 48px); margin: 0; padding: 9px 14px; border-radius: 18px; background: rgba(18,25,21,.9); color: #fff; font-size: 10px; opacity: 0; pointer-events: none; transform: translate(50%, 8px); transition: opacity .2s ease, transform .2s ease; }
.media-feed-status.is-visible { opacity: 1; transform: translate(50%, 0); }

.media-feed-shell.is-controls-hidden .media-feed-topbar,
.media-feed-shell.is-controls-hidden .media-feed-swipe-hint,
.media-feed-shell.is-controls-hidden .media-feed-actions,
.media-feed-shell.is-controls-hidden .media-feed-copy,
.media-feed-shell.is-controls-hidden .media-feed-progress { opacity: 0; pointer-events: none; }
.media-feed-shell.is-controls-hidden .media-feed-topbar { transform: translateY(-10px); }
.media-feed-shell.is-controls-hidden .media-feed-actions { transform: translateX(12px); }
.media-feed-shell.is-controls-hidden .media-feed-copy,
.media-feed-shell.is-controls-hidden .media-feed-progress { transform: translateY(12px); }
.media-feed-shell.is-controls-hidden .media-feed-shade { opacity: 0; }

.media-feed-back:focus-visible, .media-feed-active-author:focus-visible, .media-feed-controls-toggle:focus-visible, .media-feed-actions a:focus-visible, .media-feed-actions button:focus-visible, .media-feed-title:focus-visible, .media-feed-location:focus-visible, .media-feed-play:focus-visible { outline: 2px solid var(--feed-green); outline-offset: 2px; }

@keyframes feed-hint {
  0%, 100% { opacity: .55; transform: translateY(4px); }
  50% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 360px) {
  .media-feed-actions { right: 7px; gap: 11px; }
  .media-feed-controls-toggle { right: 7px; }
  .media-feed-controls-toggle > span { width: 37px; height: 37px; }
  .media-feed-actions > a > span, .media-feed-actions > button > span { width: 37px; height: 37px; }
  .media-feed-actions > .media-feed-author-avatar { width: 41px; height: 41px; min-width: 41px; }
  .media-feed-copy { right: 62px; left: 11px; }
  .media-feed-title h1 { font-size: 16px; }
  .media-feed-copy > p { font-size: 9px; }
}

@media (min-width: 700px) {
  .media-feed-shell { box-shadow: 0 0 60px rgba(0,0,0,.58); }
}

@media (prefers-reduced-motion: reduce) {
  .media-feed, .media-feed-gallery { scroll-behavior: auto; }
  .media-feed-swipe-hint svg { animation: none; }
  .media-feed-shade, .media-feed-topbar, .media-feed-controls-toggle, .media-feed-swipe-hint, .media-feed-actions, .media-feed-copy, .media-feed-play, .media-feed-progress, .media-feed-status { transition: none; }
}
