*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:Arial,Helvetica,'Segoe UI',sans-serif;background:#f7f7f8;color:#222}
.app{min-height:100vh;display:flex;flex-direction:column}
.app-header{padding:10px 12px;background:#fff;text-align:center;box-shadow:0 1px 0 rgba(0,0,0,0.06);position:sticky;top:0;z-index:10}
.app-header h1{margin:0;font-size:18px}
.app-main{flex:1;padding:12px 12px 72px}
.app-header{padding:10px 12px;background:#fff;text-align:center;box-shadow:0 1px 0 rgba(0,0,0,0.06);position:sticky;top:0;z-index:10}
.app-header h1{margin:0;font-size:18px}
.app-main{flex:1;padding:12px 12px;padding-bottom:80px}
.bottom-nav{position:fixed;left:0;right:0;bottom:0;height:56px;background:#fff;display:flex;border-top:1px solid #e6e6e6}
.bottom-nav button{flex:1;border:0;background:transparent;font-size:14px;color:#666;padding:8px 6px}
.bottom-nav button.active{color:#0b79ff;font-weight:600}
textarea{width:100%;min-height:80px;margin:8px 0;padding:8px;border:1px solid #ddd;border-radius:6px;resize:vertical}
.actions{margin-top:8px}
.posts{margin-top:12px;padding:0;list-style:none}
.posts li{background:#fff;padding:10px;border-radius:6px;margin-bottom:8px;box-shadow:0 1px 0 rgba(0,0,0,0.04)}

/* Home: search + carousel + buttons + waterfall */
.search-wrap{padding:6px 0}
.search-box{width:100%;padding:8px 10px;border-radius:18px;border:1px solid #e0e0e0;background:#fff;font-size:13px}

.carousel{margin-top:8px;position:relative;overflow:hidden;border-radius:10px}
.carousel .slides{position:relative;height:150px}
.carousel .slide{position:absolute;inset:0;opacity:0;transform:scale(1.02);transition:opacity .5s,transform .5s}
.carousel{margin-top:8px;position:relative;overflow:hidden;border-radius:8px}
.carousel .slides{position:relative;height:140px}
.carousel .slide{position:absolute;inset:0;opacity:0;transform:scale(1.01);transition:opacity .36s,transform .36s}
.carousel .slide.active{opacity:1;transform:scale(1)}
.carousel img{width:100%;height:160px;object-fit:cover;display:block}
.carousel .dots{position:absolute;left:50%;transform:translateX(-50%);bottom:8px;display:flex;gap:6px}
.carousel .dots span{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,0.7);display:block;cursor:pointer}
.carousel .dots span.active{background:#0b79ff}

.fun-buttons{display:flex;gap:6px;margin:8px 0}
.fun-btn{flex:1;padding:8px 6px;border-radius:8px;border:1px solid #eee;background:#fff;color:#333;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}
.fun-buttons{display:flex;gap:6px;margin:8px 0}
.fun-btn{flex:1;padding:8px 6px;border-radius:6px;border:1px solid #eee;background:#fff;color:#333;font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.home-controls{display:flex;justify-content:flex-end;margin-bottom:8px}
.home-controls .sort{font-size:14px;color:#666}
.home-controls .sort button{margin-left:8px;padding:6px 10px;border-radius:6px;border:1px solid #eee;background:#fff;cursor:pointer}
.home-controls .sort button.active{background:#0b79ff;color:#fff;border-color:#0b79ff}

/* vertical stacked card list */
.waterfall{display:flex;flex-direction:column;gap:12px;padding-bottom:6px}
.waterfall .post-card{width:100%;border-radius:8px;background:#fff;padding:10px;box-shadow:0 1px 0 rgba(0,0,0,0.04)}
.post-img{width:100%;height:160px;object-fit:cover;border-radius:6px;margin-bottom:8px}
.waterfall{display:flex;flex-direction:column;gap:8px;padding-bottom:6px}
.waterfall .post-card{width:100%;border-radius:8px;background:#fff;padding:8px;box-shadow:0 1px 0 rgba(0,0,0,0.04)}
.post-img{width:100%;height:140px;object-fit:cover;border-radius:6px;margin-bottom:6px}
.post-title{margin:0 0 4px;font-size:15px}
.post-excerpt{margin:0;color:#555;font-size:13px}

@media(min-width:900px){.waterfall{max-width:1100px;margin:0 auto}}
.post-img.loaded{opacity:1;transform:none}
.post-title{margin:0 0 6px;font-size:16px}
.post-excerpt{margin:0;color:#555;font-size:14px}

/* Post layout: title with time to right, one-line excerpt with ellipsis */
.post-card{display:flex;align-items:flex-start;gap:12px;padding:10px;border-radius:8px}
.post-img-wrap{width:120px;flex:0 0 120px;display:flex;align-items:center;justify-content:center;height:80px}
.post-img{width:120px;height:80px;object-fit:cover;border-radius:6px;display:block}
.post-main{flex:1;min-width:0;display:flex;flex-direction:column;min-height:80px}
.post-header{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.post-title{font-size:15px;margin:0;color:#222;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.post-time{font-size:12px;color:#999;flex:0 0 auto;margin-left:8px}
.post-excerpt {display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;line-clamp: 1;overflow: hidden;text-overflow: ellipsis;/* 可选：在需要时保持行高和字体以保证截断效果 *//* line-height: 1.4em; max-height: 1.4em; */}

/* action buttons row (anchored to bottom of post-main) */
.post-actions{display:flex;gap:12px;align-items:center;margin-top:auto}
.action-btn{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;color:#888;padding:0;font-size:13px;cursor:default}
.action-btn .icon{display:block}
.action-btn .icon-path{fill:none}
.action-btn .count{color:#888;font-size:13px}
.action-btn.heart.liked,.action-btn.heart.liked .icon-path{color:#ff6b9d}
.action-btn.heart.liked .icon-path{fill:#ff6b9d;stroke:#ff6b9d}
.action-btn.star.collected,.action-btn.star.collected .icon-path{color:#ff9900}
.action-btn.star.collected .icon-path{fill:#ffb36b;stroke:#ff9900}


@media(min-width:900px){.waterfall{max-width:1100px;margin:0 auto}}

/* toast */
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:76px;background:rgba(0,0,0,0.75);color:#fff;padding:8px 12px;border-radius:18px;font-size:14px;opacity:0;transition:opacity .25s;z-index:9999}
.toast.show{opacity:1}

/* Firefox flash fix: hide site briefly until stable */
.hidden-site{visibility:hidden !important;opacity:0 !important;pointer-events:none !important;transition:none !important}

/* ---- Compact overrides for tighter layout and simplified sort ---- */
.search-wrap{margin-bottom:6px}
.carousel{margin-bottom:6px}
.fun-buttons{display:flex;gap:6px;margin:8px 0}
.fun-btn{flex:1;padding:8px 6px;border-radius:6px;border:1px solid #eee;background:#fff;color:#333;font-weight:600;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.home-controls{padding:4px 8px;margin-bottom:6px}
.home-controls .sort{display:inline-flex;align-items:center;gap:6px;color:#888;font-size:12px}
.home-controls .sort-item{background:transparent;border:0;padding:0;margin:0;color:#888;font-size:12px;cursor:pointer;appearance:none}
.home-controls .sort-item:focus{outline:none}
.home-controls .sort-item:hover{color:#888}
.home-controls .sort-item.active{color:#000;font-weight:400}
.home-controls .divider{color:#ccc;padding:0 6px;line-height:1}
.waterfall{gap:8px}
.post-card{margin-bottom:8px}


