/* ==========================================================================
   Forum: categories, thread list, posts, composer, reactions
   ========================================================================== */

.forum-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 36px 0 80px; }
.forum-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.forum-head h1 { font-size: clamp(32px, 4.4vw, 48px); letter-spacing: -.02em; line-height: 1.05; }
.forum-head p { margin: 6px 0 0; color: var(--text-2); }
.forum-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .forum-layout { grid-template-columns: 1fr; } .forum-side { order: 2; } }
.forum-side { position: sticky; top: calc(var(--nav-h) + 20px); }
.forum-side h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 0 0 8px 12px; }
.sidecats { display: grid; gap: 2px; margin-bottom: 24px; }
.sidecats a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--text); font-size: 15px; }
.sidecats a:hover { background: var(--bg-alt); text-decoration: none; }
.sidecats a.is-active { background: #e8f1fd; font-weight: 600; }
.catdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sidecats small { margin-left: auto; color: var(--text-3); }
.forum-search { position: relative; margin-bottom: 20px; }
.forum-search input { padding-left: 38px; border-radius: 12px; font-size: 15px; padding-top: 10px; padding-bottom: 10px; }
.forum-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }

/* category grid */
.catgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 36px; }
@media (max-width: 700px) { .catgrid { grid-template-columns: 1fr; } }
.catcard { display: flex; gap: 14px; background: #fff; border: 1px solid var(--line-soft); border-radius: 18px; padding: 18px 20px; color: var(--text); transition: box-shadow .25s var(--ease), transform .25s var(--ease); position: relative; overflow: hidden; }
.catcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.catcard:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-2px); }
.catcard__icon { font-size: 28px; width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--c) 14%, #fff); flex: none; }
.catcard h3 { font-size: 18px; letter-spacing: -.01em; }
.catcard p { font-size: 14px; color: var(--text-2); margin: 3px 0 8px; line-height: 1.35; }
.catcard__stats { font-size: 12px; color: var(--text-3); }

/* thread list */
.threadlist { background: #fff; border: 1px solid var(--line-soft); border-radius: 18px; overflow: hidden; }
.threadlist--card { box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.threadrow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-soft); color: var(--text); }
.threadrow:first-child { border-top: 0; }
.threadrow:hover { background: var(--paper); text-decoration: none; }
.threadrow__avatar { width: 36px; height: 36px; border-radius: 50%; }
.threadrow__title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.threadrow__meta { font-size: 13px; color: var(--text-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.threadrow__count { text-align: center; font-size: 17px; font-weight: 600; min-width: 56px; line-height: 1.1; }
.threadrow__count small { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; }
.threadrow.is-pinned { background: #f8fbff; }
.threadrow .badge { font-size: 11px; padding: 3px 7px; }
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-2); }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }

/* thread page */
.thread-title { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.12; letter-spacing: -.02em; margin: 8px 0 12px; }
.thread-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--text-3); font-size: 14px; margin-bottom: 24px; }
.post { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; padding: 24px 0; border-top: 1px solid var(--line-soft); scroll-margin-top: 80px; }
.post:first-of-type { border-top: 0; }
.post:target .post__card { box-shadow: 0 0 0 3px rgba(0,113,227,.35); }
.post__avatar img { width: 56px; height: 56px; border-radius: 50%; }
.post__card { background: #fff; border: 1px solid var(--line-soft); border-radius: 18px; padding: 18px 22px 14px; transition: box-shadow .3s; }
.post.is-op .post__card { background: #fbfdff; border-color: #cfe3fb; }
.post__head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; margin-bottom: 10px; }
.post__head strong { font-size: 16px; }
.post__head .time { color: var(--text-3); }
.post__head .spacer { margin-left: auto; }
.role-badge { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--paper-2); color: #424245; }
.role-badge--admin { background: #ffe3e3; color: #b3001b; }
.role-badge--moderator, .role-badge--editor { background: #e1efff; color: #0058b9; }
.post__body { font-size: 16.5px; line-height: 1.55; overflow-wrap: anywhere; }
.post__body p { margin: 0 0 .85em; }
.post__body blockquote { margin: .6em 0 1em; padding: 6px 0 6px 16px; border-left: 3px solid #c7c7cc; color: var(--text-2); }
.post__body pre { background: var(--ink); color: var(--paper-2); padding: 14px 16px; border-radius: 12px; overflow: auto; font-size: 14px; }
.post__body code { background: var(--bg-alt); padding: 2px 6px; border-radius: 6px; font-size: .88em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.post__body pre code { background: none; padding: 0; }
.post__body img { border-radius: 12px; max-height: 480px; }
.post__body a.mention { background: #e8f1fd; padding: 0 5px; border-radius: 6px; font-weight: 500; }
.post__sig { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 8px; font-size: 13px; color: var(--text-3); }
.post__foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; }
.react { border: 1px solid var(--line); background: #fff; border-radius: 980px; padding: 4px 10px; font-size: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: background .15s, border-color .15s, transform .15s; }
.react:hover { background: var(--bg-alt); transform: translateY(-1px); }
.react.is-mine { background: #e8f1fd; border-color: #8bbcf3; }
.react b { font-size: 12px; font-weight: 600; color: var(--text-2); }
.react.is-zero b { display: none; }
.react.is-zero { opacity: .55; }
.react.is-zero:hover { opacity: 1; }
.post__actions { margin-left: auto; display: flex; gap: 12px; }
.post__actions button, .post__actions a { background: none; border: 0; padding: 4px; font-size: 13px; color: var(--text-3); cursor: pointer; }
.post__actions button:hover, .post__actions a:hover { color: var(--text); text-decoration: underline; }
.post.is-deleted .post__body { color: var(--text-3); font-style: italic; }
.replying { background: var(--bg-alt); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; display: none; }
.replying.is-on { display: flex; justify-content: space-between; gap: 10px; }

/* composer */
.composer { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.composer__bar { display: flex; gap: 2px; align-items: center; padding: 8px 10px; background: var(--paper); border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.composer__bar button { border: 0; background: transparent; width: 34px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--text-2); }
.composer__bar button:hover { background: var(--paper-2); color: var(--text); }
.composer__tabs { margin-left: auto; display: flex; gap: 2px; }
.composer__tabs button { width: auto; padding: 0 12px; font-size: 13px; font-weight: 500; }
.composer__tabs button.is-active { background: var(--paper-2); color: var(--text); }
.composer textarea { border: 0; border-radius: 0; box-shadow: none !important; min-height: 160px; font-size: 16px; padding: 16px 18px; }
.composer__preview { padding: 16px 18px; min-height: 160px; display: none; }
.composer__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line-soft); background: var(--paper); flex-wrap: wrap; }
.composer__hint { font-size: 12px; color: var(--text-3); }
.composer.is-preview textarea { display: none; }
.composer.is-preview .composer__preview { display: block; }
.locked-note { background: var(--bg-alt); border-radius: 14px; padding: 16px 20px; text-align: center; color: var(--text-2); }

.profile-head { display: grid; grid-template-columns: 112px 1fr auto; gap: 24px; align-items: center; margin-bottom: 28px; }
.profile-head img { width: 112px; height: 112px; border-radius: 50%; }
.profile-head h1 { font-size: 34px; letter-spacing: -.02em; }
.profile-stats { display: flex; gap: 28px; }
.profile-stats strong { display: block; font-size: 26px; letter-spacing: -.02em; }
.profile-stats span { font-size: 13px; color: var(--text-3); }
@media (max-width: 720px) { .profile-head { grid-template-columns: 80px 1fr; } .profile-head img { width: 80px; height: 80px; } .profile-stats { grid-column: 1 / -1; } }

/* auth pages */
.authcard { width: min(440px, calc(100% - 32px)); margin: 56px auto 96px; }
.authcard h1 { font-size: 40px; letter-spacing: -.02em; text-align: center; margin-bottom: 8px; }
.authcard .sub { text-align: center; color: var(--text-2); margin-bottom: 28px; }
.authcard form { background: #fff; border: 1px solid var(--line-soft); border-radius: 22px; padding: 28px; box-shadow: 0 8px 40px rgba(0,0,0,.06); }
.authcard .btn { width: 100%; padding: 13px; }
.authcard .alt { text-align: center; margin-top: 20px; font-size: 15px; color: var(--text-2); }
