/* Forum: compact X/Weibo-style feed. Scoped to the forum page; reuses site tokens, header and footer. */
body[data-page=forum] .wrap{max-width:1180px}
.forum-main{display:grid;gap:10px;padding:20px 0 32px;min-width:0}
.forum-main h1{font-size:clamp(24px,3.4vw,32px);margin:0}
.forum-main>p{margin:0;max-width:760px}
.forum-muted{color:var(--ink-soft);font-size:14px}
.fc-rules{font-size:12.5px}
.forum-text{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;margin:0}
.forum-error{color:#953c28}
.forum-status-line{margin:0;min-height:0}.forum-status-line:empty{display:none}
.forum-main button:focus-visible,.forum-main textarea:focus-visible,.forum-main input:focus-visible,.forum-main a:focus-visible{outline:3px solid var(--clay);outline-offset:2px}
.fc-sm{min-height:32px;padding:4px 14px;font-size:13px;line-height:1.4;width:auto}

/* one-line composer */
.fc-compose{display:flex;align-items:center;gap:10px;max-width:760px;min-width:0}
.fc-compose-btn{flex:1;min-width:0;display:flex;align-items:center;gap:10px;height:42px;padding-block:0;padding-inline:8px 14px;border:1px solid var(--sage);border-radius:999px;background:#fff;color:var(--ink-soft);font:inherit;font-size:14.5px;text-align:start;cursor:text;overflow:hidden}
.fc-compose-btn span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fc-compose-btn:hover{border-color:var(--sage-deep)}
.fc-compose #forum-login{flex:none;white-space:nowrap}

/* feed */
.fc-feed{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,420px),1fr));gap:10px;min-width:0}
.fc-feed>p{grid-column:1/-1;margin:0}
.fc-card{display:flex;gap:10px;align-items:flex-start;background:#fff;border:1px solid #e3e8dc;border-radius:12px;padding:10px 12px;cursor:pointer;min-width:0;transition:border-color .15s,box-shadow .15s}
.fc-card:hover{border-color:var(--sage);box-shadow:0 4px 14px rgba(80,70,60,.09)}
.fc-main{flex:1;min-width:0;display:grid;gap:4px}
.fc-thumb{flex:none;width:104px;height:78px;object-fit:cover;border-radius:8px;background:var(--bg-soft)}
.fc-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12.5px;color:var(--ink-soft);min-width:0}
.fc-ava{flex:none;width:24px;height:24px;border-radius:50%;object-fit:cover;background:var(--bg-soft)}
.fc-ava-t{display:inline-grid;place-items:center;font-size:12px;font-weight:700;color:#fff;background:var(--sage-deep)}
.fc-ava-seed{background:var(--clay)}
.fc-name{font-weight:700;color:var(--ink);min-width:0;max-width:11em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fc-time{white-space:nowrap}
.fc-chip{display:inline-block;max-width:100%;background:var(--bg-soft);border:1px solid #d9e4d3;border-radius:999px;padding:0 8px;font-size:11.5px;line-height:1.6;color:var(--ink)}
.fc-chip-seed{background:#fbefe3;border-color:#efd3b9}.fc-chip-pts{background:#fff4cf;border-color:#ecdc9c}
.fc-title{margin:0;font-size:inherit}
.fc-title-btn{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;width:100%;margin:0;padding:0;border:0;background:none;color:var(--ink);font:inherit;font-weight:700;font-size:15px;line-height:1.4;text-align:start;cursor:pointer}
.fc-text{margin:0;font-size:13.5px;line-height:1.5;color:var(--ink-soft);display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;overflow-wrap:anywhere}
.fc-foot{display:flex;align-items:center;gap:14px;margin-top:2px;font-size:12.5px;color:var(--ink-soft);flex-wrap:wrap}
.fc-stat{display:inline-flex;align-items:center;gap:4px;padding:0;border:0;background:none;font:inherit;color:inherit;line-height:1}
button.fc-stat{cursor:pointer;border-radius:999px;padding:3px 6px;margin:-3px -6px}
button.fc-stat:hover{color:#b24a5c;background:#fbeef0}
.fc-like.fc-on{color:#b24a5c}.fc-like.fc-on svg path{fill:#d9697c;stroke:#b24a5c}
.fc-link{padding:0;border:0;background:none;font:inherit;font-size:12.5px;color:var(--sage-deep);cursor:pointer;text-decoration:underline}
.fc-more{display:flex;gap:10px;justify-content:center}
.fc-actions{display:flex;gap:8px}

/* dialogs */
.forum-form{display:grid;gap:8px;margin:0}
.forum-form label{font-size:13.5px;font-weight:700}
.forum-form input,.forum-form textarea,.fc-replyform textarea{font:inherit;font-size:14.5px;color:var(--ink);background:var(--bg);border:1px solid var(--sage);border-radius:10px;padding:8px 10px;min-width:0;width:100%;max-width:100%;box-sizing:border-box}
.forum-form textarea,.fc-replyform textarea{resize:vertical}
.forum-form h2{font-size:18px;margin:0}
.forum-main dialog{color:var(--ink);background:var(--bg);border:1px solid var(--sage);border-radius:14px;width:min(520px,calc(100% - 24px));max-width:calc(100% - 24px);padding:18px}
.forum-main dialog::backdrop{background:#3f3a3466}
html.forum-lock{overflow:hidden}
.forum-main #forum-detail{width:min(720px,calc(100% - 24px));max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);padding:0;overflow:auto;overscroll-behavior:contain}
.xd-bar{position:sticky;top:0;z-index:2;display:flex;justify-content:flex-end;padding:8px 10px 4px;background:linear-gradient(var(--bg) 70%,#fbf8f100)}
#forum-detail .forum-status-line{padding:0 20px}
.xd-cover{position:relative;overflow:hidden;aspect-ratio:16/7;background:var(--bg-soft)}
.xd-cover img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover}
.xd-body{padding:10px 20px 20px;display:grid;gap:10px;min-width:0}
.xd-body h2{font-size:clamp(18px,2.6vw,23px);line-height:1.3;margin:0}
.fc-credit{margin:0;font-size:12.5px;color:var(--ink-soft)}.fc-small{margin:0;font-size:12px}
.fc-banner{margin:0;padding:6px 10px;border-radius:8px;background:#fff4cf;border:1px solid #ecdc9c;font-size:13px}
.fc-banner-done{background:var(--bg-soft);border-color:#d9e4d3}
.fc-sort{display:flex;gap:6px;border-top:1px solid #e3e8dc;padding-top:10px}
.fc-sortbtn{border:1px solid #d9e4d3;background:#fff;border-radius:999px;padding:2px 12px;font:inherit;font-size:12.5px;color:var(--ink);cursor:pointer}
.fc-sortbtn.fc-on{background:var(--sage);border-color:var(--sage-deep);font-weight:700}
.fc-replies{display:grid;gap:8px}
.fc-reply{display:grid;gap:3px;padding:8px 0;border-bottom:1px solid #eef1ea}
.fc-reply:last-child{border-bottom:0}
.fc-accepted{border-inline-start:3px solid var(--sage-deep);padding-inline-start:10px}
.fc-replyform{display:grid;gap:6px;justify-items:start}

@media(max-width:639px){
 .forum-main{padding-top:14px}
 .fc-feed{grid-template-columns:1fr}
 .fc-thumb{width:84px;height:64px}
 .fc-card{padding:9px 10px}
 .fc-compose{flex-wrap:wrap}.fc-compose-btn{flex-basis:100%}
 .xd-body{padding:8px 14px 16px}#forum-detail .forum-status-line{padding:0 14px}
}

.forum-main [hidden]{display:none!important}

/* Natural-height masonry: columns preserve cards and image aspect ratios. */
.fc-feed{display:block;column-count:3;column-gap:14px}
.fc-card{display:flex;flex-direction:column;break-inside:avoid;page-break-inside:avoid;margin:0 0 14px;width:100%;box-sizing:border-box;gap:10px}
.fc-main{width:100%}
.fc-thumb{display:block;width:100%;height:auto;max-width:100%;object-fit:contain;order:-1}
.fc-title-btn,.fc-text{display:block;-webkit-line-clamp:unset;line-clamp:unset;overflow:visible;overflow-wrap:anywhere}
.xd-cover{aspect-ratio:auto}.xd-cover img{position:static;display:block;width:100%;height:auto;object-fit:contain}
@media(min-width:1440px){body[data-page=forum] .wrap{max-width:1400px}.fc-feed{column-count:4}}
@media(min-width:640px) and (max-width:999px){.fc-feed{column-count:2}}
@media(max-width:639px){.fc-feed{column-count:1}.fc-thumb{width:100%;height:auto}}

/* RTL */
/* no further overrides needed: grid/flex/column masonry and the dialog close bar (flex-end) already follow direction */

/* Mobile UX 2026-10-19 */
.fc-compose-btn{min-height:44px;height:auto;padding-block:10px;overflow:visible}.fc-compose-btn span:last-child{min-width:0;white-space:normal;overflow:visible;overflow-wrap:anywhere}.fc-compose #forum-login{white-space:normal}.fc-tabs a,.fc-tabs button{min-width:44px;min-height:44px}
