/* ==========================================================================
   std::cpp — Forum
   ========================================================================== */

.page-forum {
    background:
        radial-gradient(ellipse 60% 40% at 72% 0%, rgba(6, 182, 212, 0.08), transparent 70%),
        radial-gradient(ellipse 46% 36% at 12% 6%, rgba(37, 99, 235, 0.09), transparent 72%);
}

/* ------------------------------------------------------------------ hero */

.forum-hero {
    position: relative;
    padding: 42px 0 30px;
    overflow: hidden;
}

.forum-hero::after {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.18), transparent);
}

.forum-hero .breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 28px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.03em;
}

.forum-hero .breadcrumb a {
    color: var(--muted);
}

.forum-hero .breadcrumb a:hover {
    color: var(--blue);
}

.forum-hero .breadcrumb .sep {
    color: rgba(37, 99, 235, 0.3);
}

.forum-hero .breadcrumb .current {
    color: var(--blue);
}

.forum-hero-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
}

.forum-hero-row h1 {
    margin: 14px 0 12px;
    color: var(--ink);
    font-family: var(--mono);
    font-size: clamp(38px, 5.4vw, 62px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.055em;
}

.forum-hero-row h1 .prefix {
    color: rgba(37, 99, 235, 0.32);
    font-weight: 500;
}

.forum-hero-row p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.8;
}

.forum-count {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 148px;
    padding: 22px 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-sm);
    flex: none;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.forum-count strong {
    position: relative;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 38px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.06em;
}

.forum-count strong::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 26px;
    height: 2px;
    border-radius: 2px;
    background: var(--grad);
    transform: translateX(-50%);
}

.forum-count span {
    margin-top: 13px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------- controls */

.forum-controls {
    position: relative;
    margin-top: 34px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 22px 50px -30px rgba(37, 99, 235, 0.35), inset 0 0 0 1px rgba(37, 99, 235, 0.05);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.forum-controls .search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.search-field {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.search-field svg {
    position: absolute;
    left: 16px;
    width: 17px;
    height: 17px;
    color: var(--muted-2);
    pointer-events: none;
    transition: color 0.2s ease;
}

.search-field input {
    width: 100%;
    height: 48px;
    padding: 0 20px 0 45px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    color: var(--ink-2);
    background: rgba(248, 250, 255, 0.9);
    font-size: 13.5px;
    transition: border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}

.search-field input::placeholder {
    color: var(--muted-2);
}

.search-field input:focus {
    border-color: rgba(37, 99, 235, 0.45);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.search-field:focus-within svg {
    color: var(--blue);
}

/* ------------------------------------------------------------------ body */

.forum-body {
    padding: 48px 0 20px;
}

.forum-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 286px;
    gap: 38px;
    align-items: start;
}

.result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 0 4px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.03em;
}

.result-bar .query {
    color: var(--blue);
}

/* --------------------------------------------------------------- topic cards */

.topic-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.topic-stack[hidden] {
    display: none;
}

.topic-card {
    position: relative;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 18px;
    padding: 24px 26px 22px 0;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: transform 0.32s var(--ease), box-shadow 0.32s ease, border-color 0.32s ease, background 0.32s ease;
}

.topic-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(520px circle at 12% 0%, rgba(37, 99, 235, 0.08), transparent 60%);
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.topic-card::after {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--grad);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.35s var(--ease);
}

.topic-card:hover {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.topic-card:hover::before {
    opacity: 1;
}

.topic-card:hover::after {
    transform: scaleY(1);
}

.topic-number {
    position: relative;
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
    color: rgba(37, 99, 235, 0.28);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.topic-number::after {
    content: "";
    position: absolute;
    top: 9px;
    right: -10px;
    bottom: 2px;
    width: 1px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), transparent);
}

.topic-main {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.topic-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.03em;
}

.topic-board-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--blue);
    background: rgba(37, 99, 235, 0.07);
    font-size: 9.5px;
}

.topic-topline .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--muted-2);
    opacity: 0.6;
}

.topic-card h2 {
    margin: 0 0 9px;
    font-size: 19px;
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: -0.02em;
}

.topic-card h2 a {
    color: var(--ink-2);
}

.topic-card h2 a:hover {
    color: var(--blue);
}

.topic-summary {
    margin: 0 0 17px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topic-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 14px;
    border-top: 1px dashed rgba(37, 99, 235, 0.1);
}

.topic-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

.topic-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.topic-meta svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

.topic-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10.5px;
    transition: color 0.2s ease;
}

.topic-read svg {
    width: 13px;
    height: 13px;
    transition: transform 0.25s var(--ease);
}

.topic-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: none;
}

.topic-actions .fav-btn {
    min-height: 36px;
    padding: 6px 14px;
    font-size: 11px;
}

.topic-actions .fav-btn:disabled {
    cursor: wait;
    opacity: 0.6;
    transform: none;
}

.topic-card:hover .topic-read {
    color: var(--blue);
}

.topic-card:hover .topic-read svg {
    transform: translateX(4px);
}

/* --------------------------------------------------------------- badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-pin {
    color: var(--blue);
    background: rgba(37, 99, 235, 0.08);
}

.badge-essence {
    color: #d97706;
    background: rgba(217, 119, 6, 0.08);
}

.badge-lock {
    color: var(--muted);
    background: rgba(100, 116, 139, 0.1);
}

/* --------------------------------------------------------------- sidebar */

.forum-aside {
    position: sticky;
    top: calc(var(--nav-h) + 22px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.boards-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
}

.boards-card .side-head {
    margin-bottom: 13px;
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.board-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
    font-size: 13px;
    transition: all 0.2s ease;
}

.board-link:hover {
    color: var(--blue);
    background: rgba(37, 99, 235, 0.05);
}

.board-link.is-active {
    color: var(--blue);
    background: rgba(37, 99, 235, 0.08);
    font-weight: 600;
}

.board-link .board-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--grad-soft);
    font-size: 14px;
}

.board-link .board-name {
    flex: 1;
}

.board-link .board-count {
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

.publish-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
}

.publish-card h3 {
    margin: 0 0 6px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 650;
}

.publish-card p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.75;
}

.publish-card .btn {
    width: 100%;
}

/* ------------------------------------------------------------- pagination */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px dashed rgba(37, 99, 235, 0.12);
}

.page-btn {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.78);
    font-family: var(--mono);
    font-size: 11px;
    transition: all 0.2s ease;
}

.page-btn:hover {
    color: var(--blue);
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.page-btn.is-active {
    color: #fff;
    background: var(--grad);
    border-color: transparent;
    box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.7);
}

.page-btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-gap {
    padding: 0 3px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

.page-info {
    margin-left: 8px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

/* ------------------------------------------------------------- empty state */

.empty-state {
    position: relative;
    padding: 66px 30px;
    border: 1px dashed rgba(37, 99, 235, 0.24);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.55);
    text-align: center;
    overflow: hidden;
}

.empty-state::before {
    content: "";
    position: absolute;
    top: -80px;
    left: 50%;
    width: 300px;
    height: 300px;
    margin-left: -150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1), transparent 66%);
    pointer-events: none;
}

.empty-state .empty-code {
    position: relative;
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--blue);
    background: rgba(255, 255, 255, 0.9);
    font-family: var(--mono);
    font-size: 11px;
}

.empty-state h2 {
    position: relative;
    margin: 18px 0 8px;
    color: var(--ink-2);
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.empty-state p {
    position: relative;
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 13px;
}

/* ==============================================================
   Topic Detail
   ============================================================== */

.topic-detail-hero {
    position: relative;
    padding: 34px 0 30px;
}

.topic-detail-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.18) 30%, rgba(6, 182, 212, 0.14) 70%, transparent);
}

.topic-detail-hero .breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 28px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 11px;
}

.topic-detail-hero .breadcrumb a {
    color: var(--muted);
}

.topic-detail-hero .breadcrumb a:hover {
    color: var(--blue);
}

.topic-detail-hero .breadcrumb .sep {
    color: rgba(37, 99, 235, 0.3);
}

.topic-detail-hero .breadcrumb .current {
    color: var(--blue);
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-detail-labels {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 16px;
}

.topic-detail-labels .category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 999px;
    color: var(--blue);
    background: rgba(37, 99, 235, 0.06);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.topic-detail-labels .category::before {
    content: "#";
    opacity: 0.55;
}

.topic-detail-hero h1 {
    max-width: 960px;
    margin: 0 0 20px;
    color: var(--ink);
    font-size: clamp(30px, 4.2vw, 50px);
    font-weight: 760;
    line-height: 1.24;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.topic-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 22px;
    color: var(--muted-2);
    font-size: 12px;
}

.topic-detail-meta .author {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 11.5px;
}

.topic-detail-meta .author .avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: #fff;
    background: var(--grad);
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 6px 14px -8px rgba(37, 99, 235, 0.8);
}

.topic-detail-meta .meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 10.5px;
}

.topic-detail-meta .meta svg {
    width: 13px;
    height: 13px;
    opacity: 0.7;
}

/* --------------------------------------------------------------- layout */

.detail-wrap {
    padding: 32px 0 0;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 282px;
    gap: 34px;
    align-items: start;
}

/* --------------------------------------------------------------- posts */

.posts-panel {
    position: relative;
    min-width: 0;
    padding: 42px 46px 34px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 26px 60px -38px rgba(37, 99, 235, 0.34), inset 0 0 0 1px rgba(37, 99, 235, 0.045);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.posts-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 46px;
    right: 46px;
    height: 2px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.5), rgba(6, 182, 212, 0.4), transparent);
    opacity: 0.65;
}

.post-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 13px;
    padding: 18px 0;
    border-top: 1px dashed rgba(37, 99, 235, 0.1);
    scroll-margin-top: calc(var(--nav-h) + 24px);
}

.post-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.post-main {
    min-width: 0;
}

.post-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 16px -10px rgba(37, 99, 235, 0.7);
    overflow: hidden;
}

.post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-item:nth-child(3n+2) .post-avatar {
    background: linear-gradient(135deg, #7c3aed, #c026d3);
}

.post-item:nth-child(3n+3) .post-avatar {
    background: linear-gradient(135deg, #0d9488, #06b6d4);
}

.post-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.post-header strong {
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
}

.post-header .floor {
    color: var(--blue);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
}

.post-header .time {
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 9px;
}

.post-header .reply-tag {
    max-width: 240px;
    overflow: hidden;
    color: var(--blue);
    font-family: var(--mono);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-children:not(.has-children) {
    margin: 0;
    padding: 0;
    border: 0;
}

.post-children.has-children {
    margin-top: 10px;
    padding-left: 18px;
    border-left: 1px dashed rgba(37, 99, 235, 0.18);
}

.post-children .post-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 11px;
    padding: 12px 0 0;
    border-top: 0;
}

.post-children .post-item + .post-item {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px dashed rgba(37, 99, 235, 0.1);
}

.post-children .post-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 10px;
}

.post-children .post-header strong {
    font-size: 11px;
}

.post-children .post-content {
    font-size: 13.5px;
}

.post-children .post-children.has-children {
    padding-left: 14px;
}

.post-children .post-children .post-children .post-children.has-children {
    padding-left: 8px;
}

.post-content {
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.85;
    overflow-wrap: break-word;
}

.post-content p {
    margin: 0 0 1em;
}

.post-content p:last-child {
    margin-bottom: 0;
}

.quote-block {
    margin: 0 0 12px;
    padding: 12px 16px;
    border-left: 3px solid rgba(37, 99, 235, 0.35);
    border-radius: 0 10px 10px 0;
    background: linear-gradient(120deg, rgba(37, 99, 235, 0.045), rgba(6, 182, 212, 0.03));
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.7;
}

.post-footer-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.post-footer-bar .btn-reply {
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-footer-bar .btn-reply svg {
    width: 14px;
    height: 14px;
    flex: none;
}

.post-footer-bar .btn-reply:hover {
    color: var(--blue);
    border-color: rgba(37, 99, 235, 0.3);
    background: rgba(37, 99, 235, 0.05);
}

.reply-target-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 1px dashed rgba(37, 99, 235, 0.22);
    border-radius: 9px;
    color: var(--muted);
    background: rgba(37, 99, 235, 0.035);
    font-family: var(--mono);
    font-size: 10px;
}

.reply-target-hint[hidden] {
    display: none;
}

.reply-target-hint strong {
    color: var(--blue);
    font-weight: 600;
}

.reply-target-hint button {
    padding: 0;
    border: 0;
    color: var(--muted-2);
    background: transparent;
    font-family: var(--mono);
    font-size: 9px;
    cursor: pointer;
}

.reply-target-hint button:hover {
    color: var(--blue);
}

/* --------------------------------------------------------------- reply form */

.reply-section {
    margin-top: 38px;
}

.reply-card {
    max-width: 860px;
    padding: 32px 36px 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
}

.reply-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.reply-head h2 {
    margin: 8px 0 0;
    color: var(--ink);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.reply-head h2 span {
    color: var(--blue);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    vertical-align: 0.2em;
}

.reply-head .mono {
    color: var(--muted-2);
    font-size: 9.5px;
    letter-spacing: 0.05em;
}

.reply-form-wrap {
    margin-bottom: 26px;
}

.reply-input-wrap {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(248, 250, 255, 0.8);
    transition: border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}

.reply-input-wrap:focus-within {
    border-color: rgba(37, 99, 235, 0.4);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.07);
}

.reply-input-wrap textarea {
    display: block;
    width: 100%;
    min-height: 104px;
    padding: 14px 15px;
    border: 0;
    outline: none;
    resize: vertical;
    color: var(--ink-2);
    background: transparent;
    font-size: 13.5px;
    line-height: 1.8;
}

.reply-input-wrap textarea::placeholder {
    color: var(--muted-2);
}

.reply-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
}

.reply-form-foot .hint {
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 9.5px;
}

.reply-form-foot .btn {
    min-height: 40px;
    font-size: 12.5px;
}

.reply-login {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding: 16px 18px;
    border: 1px dashed rgba(37, 99, 235, 0.22);
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.035);
}

.reply-login p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
}

.reply-login .mono {
    color: var(--blue);
    font-size: 10px;
}

.locked-notice {
    margin-top: 28px;
    padding: 22px;
    border: 1px dashed rgba(37, 99, 235, 0.22);
    border-radius: 12px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.locked-notice .mono {
    display: block;
    margin-bottom: 8px;
    color: rgba(37, 99, 235, 0.5);
    font-family: var(--mono);
    font-size: 10px;
}

/* --------------------------------------------------------------- actions */

.topic-actions-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px dashed rgba(37, 99, 235, 0.14);
}

.fav-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 9px;
    min-height: 44px;
    padding: 9px 20px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 11px;
    color: var(--blue);
    background: rgba(37, 99, 235, 0.055);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s var(--ease);
}

.fav-btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.fav-btn:hover {
    color: #fff;
    background: var(--grad);
    border-color: transparent;
    box-shadow: 0 12px 26px -12px rgba(37, 99, 235, 0.6);
    transform: translateY(-2px);
}

.fav-btn.is-faved {
    color: #fff;
    background: var(--grad);
    border-color: transparent;
    box-shadow: 0 12px 26px -12px rgba(37, 99, 235, 0.55);
}

/* ==============================================================
   Editor / Post Form
   ============================================================== */

.editor-wrap {
    padding: 42px 0 20px;
}

.editor-card {
    max-width: 860px;
    margin: 0 auto;
    padding: 42px 46px 34px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 26px 60px -38px rgba(37, 99, 235, 0.34), inset 0 0 0 1px rgba(37, 99, 235, 0.045);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.editor-card h2 {
    margin: 0 0 28px;
    color: var(--ink);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    color: var(--ink-2);
    background: rgba(248, 250, 255, 0.9);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: rgba(37, 99, 235, 0.45);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed rgba(37, 99, 235, 0.14);
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
    .forum-grid,
    .detail-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
        gap: 24px;
    }

    .topic-card {
        padding-right: 20px;
    }

    .posts-panel {
        padding: 34px 34px 30px;
    }

    .editor-card {
        padding: 34px 34px 30px;
    }
}

@media (max-width: 860px) {
    .forum-grid,
    .detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .forum-aside,
    .detail-aside {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .forum-count {
        width: 126px;
    }

    .forum-count strong {
        font-size: 32px;
    }

    .posts-panel {
        padding: 26px 20px 24px;
    }

    .editor-card {
        padding: 26px 20px 24px;
    }
}

@media (max-width: 640px) {
    .forum-hero {
        padding-top: 26px;
    }

    .forum-hero-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 22px;
    }

    .forum-count {
        flex-direction: row;
        align-items: baseline;
        gap: 10px;
        width: auto;
        padding: 12px 16px;
    }

    .forum-count strong {
        font-size: 24px;
    }

    .forum-count strong::after {
        display: none;
    }

    .forum-count span {
        margin: 0;
    }

    .forum-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-field input {
        padding-right: 16px;
    }

    .topic-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 20px 20px 18px;
    }

    .topic-number {
        justify-content: flex-start;
        margin-bottom: 10px;
        padding: 0;
        font-size: 11px;
    }

    .topic-number::after {
        display: none;
    }

    .topic-card h2 {
        font-size: 17px;
    }

    .topic-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .forum-aside {
        grid-template-columns: minmax(0, 1fr);
    }

    .pagination {
        justify-content: flex-start;
    }

    .page-info {
        width: 100%;
        margin: 6px 0 0;
    }

    .topic-detail-hero h1 {
        font-size: 27px;
    }

    .topic-detail-meta {
        gap: 10px 16px;
    }

    .reply-card {
        padding: 24px 20px 20px;
    }

    .reply-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .reply-login {
        align-items: flex-start;
        flex-direction: column;
    }

    .editor-card h2 {
        font-size: 21px;
    }

    .editor-actions .btn {
        flex: 1;
    }
}
