/* Layout: a single app column, full screen on phones, centred 480px column on wide screens. */
:root{
  --desk:#efeff1;           /* page behind the app column on wide screens */
  --ink:#1b1b1d;            /* app text */
  --ink-2:#55575c;          /* captions */
  --ink-3:#9a9ca1;          /* meta, end-of-feed */
  --line:#e6e6e8;
  --paper:#ffffff;
  --sun:#f7a21b;            /* app accent: orange → coral */
  --coral:#ef4f2c;
  --menu:rgba(22,22,24,.9);
  --skel:#ececee;
  --f-ui:"Nunito Sans","Noto Sans SC",system-ui,-apple-system,"PingFang SC",sans-serif;
  --f-text:"Noto Sans SC","PingFang SC","Hiragino Sans","Apple SD Gothic Neo","Microsoft YaHei",system-ui,sans-serif;
  color-scheme:light;
}
html,body{height:100%;margin:0}
body{background:var(--desk);color:var(--ink);font-family:var(--f-text);display:flex;justify-content:center;overflow:hidden}
*{box-sizing:border-box}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
a{color:inherit}
button:focus-visible,a:focus-visible{outline:2px solid var(--sun);outline-offset:2px;border-radius:6px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- app column ---------- */
.handset{width:100%;max-width:480px;height:100%;background:var(--paper);box-shadow:0 0 0 1px rgba(0,0,0,.05),0 12px 40px rgba(0,0,0,.10)}
.screen{position:relative;width:100%;height:100%;overflow:hidden;background:var(--paper);isolation:isolate}

/* ---------- views ---------- */
.view{position:absolute;inset:0;display:flex;flex-direction:column;background:var(--paper);
  transition:transform .32s cubic-bezier(.2,.8,.2,1),opacity .25s;will-change:transform}
.view.off-right{transform:translateX(100%);visibility:hidden;transition:transform .32s cubic-bezier(.2,.8,.2,1),visibility 0s .32s}
@media (prefers-reduced-motion:reduce){.view,.view.off-right{transition:none}}

/* ---------- app shell ---------- */
.scroll{flex:1;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}
.scroll::-webkit-scrollbar{display:none}
.bar{flex:none;display:flex;align-items:center;gap:14px;height:52px;padding:0 14px;border-bottom:1px solid var(--line);font-family:var(--f-ui);font-weight:600;font-size:18px;background:var(--paper);min-width:0}
.bar span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bar .back{flex:none;width:28px;height:28px;display:grid;place-items:center;margin-left:-4px}

.tabbar{flex:none;position:relative;display:grid;grid-template-columns:repeat(3,1fr);height:56px;border-top:1px solid #f0f0f0;background:var(--paper)}
.tabbar button{display:grid;place-items:center;color:#2a2a2d}
.tabbar svg{width:25px;height:25px}
.tabbar .ind{position:absolute;bottom:0;left:0;width:33.333%;height:4px;background:linear-gradient(90deg,var(--sun),var(--coral));transition:transform .28s cubic-bezier(.2,.8,.2,1)}

/* feed source line */
.src{display:flex;align-items:baseline;gap:8px;padding:12px 16px;font-size:13px;color:var(--ink-3);border-bottom:1px solid #f3f3f3}
.src b{font-family:var(--f-ui);font-weight:700;color:var(--ink-2)}

/* post card */
.post{background:var(--paper);padding-bottom:40px}
button,.photo{-webkit-tap-highlight-color:transparent}
#feed{touch-action:pan-y;scroll-snap-type:y proximity}
/* The header is a snap target too, so the feed stays pinned to the top while pages stream in. */
#feed .src,#feed .post:not(.skel){scroll-snap-align:start}
.photo{display:block;width:100%;aspect-ratio:16/9;background:#1b1b1d;position:relative;overflow:hidden}
.photo img{display:block;width:100%;height:100%;object-fit:cover}
@keyframes bump{0%{transform:scale(1)}35%{transform:scale(1.35)}70%{transform:scale(.9)}100%{transform:scale(1)}}
.bump{animation:bump .35s ease-out}
.heartpop{z-index:2;position:absolute;left:50%;top:50%;width:90px;height:90px;margin:-45px 0 0 -45px;opacity:0;transform:scale(.4);pointer-events:none;filter:drop-shadow(0 4px 12px rgba(0,0,0,.35))}
.heartpop.go{animation:pop .7s ease-out}
@keyframes pop{0%{opacity:0;transform:scale(.4)}25%{opacity:1;transform:scale(1.1)}60%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1)}}
.meta{padding:16px 16px 0}
.who{display:flex;align-items:center;gap:9px;max-width:100%;font-family:var(--f-ui);font-weight:600;font-size:17px;color:var(--ink)}
.who span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.av{flex:none;width:26px;height:26px;border-radius:50%;overflow:hidden;display:block;background:var(--skel)}
.av img,.bigav img{display:block;width:100%;height:100%;object-fit:cover}
.cap{margin-top:14px;font-size:15px;line-height:1.55;color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;width:100%;display:block}
.post.full .cap{white-space:normal;cursor:auto}
.tl{display:inline-block;margin-top:6px;font-size:12px;color:var(--ink-3)}
.tl:hover{color:var(--ink-2)}
.acts{display:flex;align-items:center;gap:22px;margin-top:14px;font-family:var(--f-ui);font-size:15px;color:var(--ink-2)}
.acts button,.acts a{display:flex;align-items:center;gap:7px;text-decoration:none}
.acts svg{width:22px;height:22px;color:var(--ink)}
.acts .on svg{color:var(--coral)}

.end{display:block;width:100%;padding:16px 16px 18px;text-align:center;color:var(--ink-3);font-size:16px;letter-spacing:1px;background:#f5f5f6}
.end.err{color:var(--coral)}
.fine{padding:4px 24px 22px;text-align:center;font-size:11px;line-height:1.6;color:var(--ink-3);background:#f5f5f6}
.empty{padding:70px 30px;text-align:center;color:var(--ink-3);font-size:15px;line-height:1.7;white-space:pre-line}

/* loading placeholders */
.skel .photo{background:var(--skel)}
.skel .line{height:14px;border-radius:7px;background:var(--skel);margin-top:14px}
.skel .line.s{width:40%;margin-top:0}
@keyframes shimmer{0%{opacity:1}50%{opacity:.55}100%{opacity:1}}
.skel .photo,.skel .line{animation:shimmer 1.4s ease-in-out infinite}

/* options sheet */
.sheet{position:absolute;inset:0;z-index:20;display:flex;flex-direction:column;gap:14px;padding:14px 14px 0;
  background:rgba(70,70,74,.42);backdrop-filter:blur(2px) grayscale(.6);opacity:0;pointer-events:none;transition:opacity .2s}
.sheet.open{opacity:1;pointer-events:auto}
.sheet .x{width:32px;height:32px;display:grid;place-items:center;color:#fff;margin-left:-2px}
.card{background:var(--menu);border-radius:10px;padding:14px 16px 16px;color:#fff;transform:translateY(-6px);transition:transform .22s}
.sheet.open .card{transform:none}
.card h4{margin:0 0 10px;font-size:15px;font-weight:500;opacity:.92}
.row{display:flex;align-items:center;gap:12px;width:100%;padding:6px 0;font-size:19px;font-weight:700;text-align:left;color:#fff;text-decoration:none}
.row + .row{margin-top:6px}
.row .go{margin-left:auto}
.ring{width:38px;height:38px;border-radius:50%;padding:2px;background:linear-gradient(140deg,#ffd23f,var(--sun) 45%,var(--coral));display:grid;place-items:center}
.ring span{width:100%;height:100%;border-radius:50%;background:#18181a;display:grid;place-items:center}
.ring svg{width:21px;height:21px;color:#fff}
.row .ico{width:24px;height:24px;margin:0 2px 0 4px;color:#fff}

/* profile */
.prof{display:flex;align-items:center;gap:6px;padding:20px 16px 14px}
.bigav{flex:none;width:80px;height:80px;margin-right:6px;border-radius:50%;padding:4px;background:conic-gradient(from 200deg,#ffd23f,var(--sun),var(--coral),#ffd23f)}
.bigav>span{display:block;width:100%;height:100%;border-radius:50%;border:3px solid #fff;overflow:hidden;background:var(--skel)}
.stats{flex:1;display:grid;grid-template-columns:1fr 1fr;text-align:center;font-family:var(--f-ui)}
.stats div + div{border-left:1px solid var(--line)}
.stats b{display:block;font-size:18px;font-weight:600}
.stats small{display:block;margin-top:10px;font-family:var(--f-text);font-size:15px;color:var(--ink-3)}
.bio{margin:0 16px 10px;padding:12px 14px;border:1px solid var(--line);border-radius:8px;font-size:15px;color:var(--ink-2);line-height:1.6}
.ext{display:block;margin:0 16px 18px;font-size:14px;color:var(--coral);text-decoration:none}
.ext:hover{text-decoration:underline}
.pgrid{display:grid;grid-template-columns:1fr 1fr;gap:3px}
.pgrid .photo{aspect-ratio:1}

/* comments */
.cm{display:flex;gap:12px;padding:14px 16px;border-bottom:1px solid #f3f3f3}
.cm .av{width:34px;height:34px}
.cm>div{min-width:0;flex:1}
.cm b{font-family:var(--f-ui);font-weight:600;font-size:15px;overflow-wrap:anywhere}
.cm p{margin:4px 0 0;font-size:15px;color:var(--ink-2);line-height:1.55;white-space:pre-line;overflow-wrap:anywhere}
.cm .meta2{display:flex;flex-wrap:wrap;gap:4px 10px;margin-top:6px;font-size:12px;color:var(--ink-3)}
.cm .meta2 .tl{margin:0;font-size:12px}
.emo{width:18px;height:18px;vertical-align:-3px}
.cm.skel .line{height:12px;border-radius:6px;background:var(--skel);margin-top:8px;animation:shimmer 1.4s ease-in-out infinite}
.older{display:block;width:100%;padding:14px;font-size:14px;color:var(--ink-2);border-bottom:1px solid #f3f3f3}
.compose{flex:none;display:flex;justify-content:center;padding:10px 12px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--paper)}
.compose a{flex:1;padding:10px 16px;border-radius:20px;text-align:center;font-weight:700;font-size:15px;color:#fff;text-decoration:none;background:linear-gradient(90deg,var(--sun),var(--coral))}

.toast{position:absolute;left:50%;bottom:76px;z-index:30;transform:translate(-50%,10px);opacity:0;padding:8px 16px;border-radius:18px;background:rgba(20,20,22,.88);color:#fff;font-size:14px;white-space:nowrap;transition:.2s;pointer-events:none}
.toast.show{opacity:1;transform:translate(-50%,0)}
