:root { color-scheme: dark; --pink: #fe2c55; --muted: rgba(255,255,255,.72); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0f0f0f; color: #fff; font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.phone {
  position: relative; width: min(100%, 430px); height: 100dvh; margin: 0 auto;
  background: #000; overflow: hidden;
  box-shadow: 0 0 0 1px #1c1c1c;
}
.top {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: 88px;
  display: flex; justify-content: center; align-items: flex-end; gap: 28px;
  padding: 0 56px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,0));
  pointer-events: none;
}
.top button { pointer-events: auto; }
.top-tab {
  position: relative; background: none; border: 0; padding: 0 2px 8px;
  color: var(--muted); font-size: 17px; font-weight: 700; letter-spacing: .2px;
}
.top-tab.on { color: #fff; }
.top-tab.on::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 26px; height: 3px;
  margin-left: -13px; border-radius: 2px; background: #fff;
}
.icon-btn {
  position: absolute; right: 8px; bottom: 6px; width: 40px; height: 40px;
  background: none; border: 0; padding: 8px;
}
.icon-btn svg, .tabbar svg, .rail svg {
  width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; background: #000; }
.slide video { width: 100%; height: 100%; object-fit: cover; background: #111; }
.video-loader {
  position: absolute; inset: 0; z-index: 2;
  display: none; place-items: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.12);
}
.video-loader.on { display: grid; }
.loader-ring {
  width: 44px; height: 44px; box-sizing: border-box;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-right-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: loader-spin 0.7s linear infinite;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45));
}
@keyframes loader-spin { to { transform: rotate(360deg); } }
.shade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); pointer-events: none;
}
.rail {
  position: absolute; right: 4px; bottom: 88px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.rail button {
  width: 56px; background: none; border: 0; color: #fff; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.75);
}
.rail .rail-act span {
  line-height: 1.1; font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
}
.rail svg {
  width: 35px; height: 35px; fill: none; stroke: #fff; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}
.rail .rail-act[data-mute] svg { width: 32px; height: 32px; }
.rail .rail-act[data-mute] .ico-vol { fill: none; }
.rail .liked svg {
  fill: var(--pink); stroke: var(--pink);
}
.rail .rail-act[data-comment] svg circle { fill: #fff; stroke: none; }
.avatar, .avatar-btn .avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(145deg, #444, #222); border: 1px solid #fff;
  display: grid; place-items: center; font-weight: 700; overflow: hidden;
}
.avatar-btn { position: relative; width: 48px !important; }
.plus {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  width: 20px; height: 20px; border-radius: 50%; background: var(--pink); color: #fff;
  font-style: normal; font-size: 16px; line-height: 18px; font-weight: 700;
  border: 1px solid #000;
}
.meta {
  position: absolute; left: 12px; right: 76px; bottom: 74px; z-index: 3;
  text-shadow: 0 1px 2px rgba(0,0,0,.65);
}
.meta .name { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.meta .cap { margin: 0 0 10px; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta .sound { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.disc {
  width: 16px; height: 16px; border-radius: 50%;
  background: conic-gradient(#222, #eee, #222, #fe2c55, #222);
  box-shadow: inset 0 0 0 4px #111;
  animation: spin 4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  height: 62px; display: flex; align-items: center;
  background: #000; border-top: .5px solid rgba(255,255,255,.12);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; height: 100%; background: none; border: 0; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; font-weight: 600; opacity: .7;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar button.on { opacity: 1; }
.tabbar button.on svg { fill: #fff; stroke: #fff; }
.progress { position: absolute; left: 0; right: 0; bottom: 62px; height: 2px; background: rgba(255,255,255,.18); z-index: 4; }
.progress > span { display: block; height: 100%; width: 0; background: #fff; }
.screen { position: absolute; inset: 0 0 62px 0; background: #000; z-index: 7; overflow: auto; }
.hidden { display: none !important; }
.search-bar { display: flex; gap: 10px; align-items: center; padding: 12px; }
.search-bar input { flex: 1; background: #2a2a2a; border: 0; border-radius: 8px; padding: 11px 12px; font-size: 15px; }
.search-bar button, .back { background: none; border: 0; color: #fff; font-size: 15px; padding: 12px 12px 0; }
#searchResult, #plist, #profile { padding: 0 12px 24px; }
.profile-head { display: flex; gap: 18px; align-items: center; padding-top: 8px; }
.profile-head img, .profile-head .avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.counts { display: flex; gap: 22px; margin: 16px 0 8px; }
.counts button, .counts div { background: none; border: 0; color: #fff; text-align: left; padding: 0; }
.counts strong { display: block; font-size: 17px; }
.counts span { color: #aaa; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 -12px; }
.grid button { border: 0; padding: 0; background: #161616; aspect-ratio: 3/4; }
.grid video { width: 100%; height: 100%; object-fit: cover; }
.subtabs { display: flex; border-bottom: .5px solid #2a2a2a; margin-top: 8px; }
.subtabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px; color: #888; }
.subtabs button.on { color: #fff; border-color: #fff; }
.user-row, .comment { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 0; border: 0; border-bottom: .5px solid #222; background: none; text-align: left; }
.user-row img, .comment img, .comment-row img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #333; flex-shrink: 0; }
.comment-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 0;
  border-bottom: .5px solid rgba(255,255,255,.08);
}
.comment-main { flex: 1; min-width: 0; }
.comment-user { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.55); margin-bottom: 4px; }
.comment-text { font-size: 15px; line-height: 1.45; color: #fff; word-break: break-word; }
.comment-like { margin-top: 8px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.45); }
.sheet { position: absolute; inset: 0; background: rgba(0,0,0,.5); z-index: 9; display: flex; align-items: flex-end; }
.sheet-card { width: 100%; height: 72%; background: #121212; border-radius: 12px 12px 0 0; display: flex; flex-direction: column; }
.sheet-card header { display: flex; justify-content: center; position: relative; padding: 14px; font-weight: 700; }
.sheet-card header button { position: absolute; right: 8px; top: 8px; background: none; border: 0; color: #fff; font-size: 18px; }
.sheet-body { overflow: auto; padding: 0 16px; flex: 1; }
.composer { padding: 10px 12px 16px; }
.composer input { width: 100%; background: #2a2a2a; border: 0; border-radius: 22px; padding: 12px 14px; }
.empty { color: #8a8a8a; text-align: center; margin-top: 28vh; padding: 0 28px; line-height: 1.6; }
#me { padding: 28px 20px; }
#me h2 { margin: 0 0 8px; font-size: 22px; }
.guest-note { color: #b5b5b5; line-height: 1.6; }
.pill { margin-top: 18px; background: var(--pink); border: 0; border-radius: 4px; padding: 12px 18px; font-weight: 700; }
.badge { display: inline-grid; place-items: center; width: 14px; height: 14px; margin-left: 6px; border-radius: 50%; background: #20d5ec; color: #000; font-size: 10px; vertical-align: 1px; }
.screen-title { margin: 16px 16px 4px; font-size: 22px; }
.discover { padding: 0 12px 24px; }
.discover-h { margin: 18px 0 8px; font-size: 14px; color: #888; font-weight: 600; }
.discover-loading, .empty-inline { color: #888; padding: 12px 4px; font-size: 14px; }
.follow-btn {
  display: block; width: 100%; max-width: 320px; margin: 12px 0;
  padding: 10px; border: 0; border-radius: 4px; background: var(--pink); color: #fff; font-weight: 700; opacity: .45;
}
.profile-head + .counts + .follow-btn + .bio, .bio { color: #ddd; line-height: 1.5; }
.skeleton {
  position: relative; height: 100%; background: linear-gradient(110deg, #111 8%, #1a1a1a 18%, #111 33%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-bar { position: absolute; left: 12px; bottom: 120px; width: 60%; height: 14px; background: rgba(255,255,255,.08); border-radius: 4px; }
.sk-rail { position: absolute; right: 12px; bottom: 140px; width: 48px; height: 200px; background: rgba(255,255,255,.06); border-radius: 8px; }
.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: rgba(40,40,40,.95); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 20;
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
}
.pill.inline { margin-top: 16px; }
