/* ========================================
   社区论坛 - 现代三栏布局样式
   ======================================== */

/* ---- 全局 CSS 变量 ---- */
:root {
    --primary: #0060a9;
    --primary-container: #409eff;
    --on-background: #091d2e;
    --on-surface: #091d2e;
    --on-surface-variant: #404752;
    --surface: #ffffff;
    --surface-container-low: #edf4ff;
    --outline: #707784;
    --outline-variant: #c0c7d4;
    --secondary: #5c5e62;
    --orange: #e6a23c;
    --orange-light: #fdf6ec;
    --red: #f56c6c;
    --red-light: #fef0f0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 40px rgba(54, 163, 247, 0.08);
    --radius-sm: 4px;
    --radius: 10px;
    --radius-lg: 12px;
    --focus-ring: 0 0 0 3px rgba(64, 158, 255, 0.1);
}

/* ---- 基础与重置 ---- */
.forum-modern {
    font-family: 'Microsoft YaHei', Inter, 'PingFang SC', sans-serif;
    background: transparent;
    color: var(--on-background);
    min-height: auto;
}

/* ---- 布局框架（三栏，版心与 task 页 xgt-profile-wrap 一致）---- */
.fm-layout {
    display: flex;
    max-width: 1800px;
    margin: 0 auto;
    padding: 24px 24px 48px;
    gap: 24px;
}

.fm-sidebar-left {
    width: 220px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-bottom: 40px;
}

.fm-main {
    flex: 1;
    min-width: 0;
    margin: 0 auto;
}

.fm-sidebar-right {
    width: 380px;
    flex-shrink: 0;
    align-self: flex-start;
}

/* ---- 左侧导航 ---- */
.fm-nav {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 12px 8px;
    border: 1px solid #f0f0f0;
}

.fm-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 1px;
    border-radius: var(--radius-sm);
    color: var(--secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    border-left: 3px solid transparent;
    justify-content: flex-start;
    text-align: left;
}

.fm-nav-divider {
    height: 1px;
    background: #e8e8e8;
    margin: 8px 12px;
}

.fm-nav-item:hover {
    background: #f5f7fa;
    color: var(--primary);
}

.fm-nav-item.active {
    background: rgba(64, 158, 255, 0.08);
    color: var(--primary-container);
    border-left-color: var(--primary-container);
    font-weight: 700;
}

.fm-nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

/* ---- 发布卡片 ---- */
.fm-publish-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid #f0f0f0;
}

.fm-publish-input-wrap {
    position: relative;
    margin-bottom: 16px;
}

.fm-publish-title {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e8ecf1;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--on-surface);
    outline: none;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    font-family: inherit;
}

.fm-publish-title:focus {
    border-color: var(--primary-container);
    box-shadow: var(--focus-ring);
}

.fm-publish-title::placeholder {
    color: #a8abb2;
}

.fm-publish-textarea {
    width: 100%;
    min-height: 130px;
    background: #f8fafc;
    border: 1px solid #e8ecf1;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 16px;
    color: var(--on-surface);
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.fm-publish-textarea[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: #94a3b8;
    pointer-events: none;
    display: block;
}

.fm-publish-textarea:focus {
    border-color: var(--primary-container);
    box-shadow: var(--focus-ring);
}

.fm-publish-textarea img.xgt-emoji-inline,
.fm-reply-textarea img.xgt-emoji-inline,
.fm-jodit-wrap img.xgt-emoji-inline {
    width: 24px;
    height: 24px;
    vertical-align: -5px;
    object-fit: contain;
    display: inline-block;
    margin: 0 2px;
}

.fm-publish-textarea::placeholder {
    color: #a8abb2;
}

.fm-publish-count {
    position: absolute;
    bottom: 12px;
    right: 14px;
    font-size: 12px;
    color: #c0c4cc;
}

.fm-publish-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.fm-publish-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.fm-publish-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: var(--secondary);
    font-size: 16px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.fm-publish-btn:hover {
    color: var(--primary);
    background: #f5f7fa;
}

.fm-publish-btn .icon {
    font-size: 16px;
    line-height: 1;
}

.fm-publish-submit-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fm-publish-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.fm-publish-select-wrap::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    width: 0;
    height: 0;
    margin-top: -2px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--outline);
    pointer-events: none;
    transition: border-top-color 0.2s ease;
}

.fm-publish-select-wrap:focus-within::after {
    border-top-color: var(--primary-container);
}

.fm-publish-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 120px;
    max-width: 160px;
    height: 36px;
    padding: 0 32px 0 12px;
    border: 1px solid #e8ecf1;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--on-surface);
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
}

.fm-publish-select:hover {
    border-color: #c6e2ff;
    background: #fff;
}

.fm-publish-select:focus {
    border-color: var(--primary-container);
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.12);
    background: #fff;
}

.fm-publish-select option {
    color: var(--on-surface);
    background: #fff;
    font-weight: 400;
}

.fm-publish-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    background: linear-gradient(135deg, #409eff, #36a3f7);
    color: #fff;
    border: none;
    padding: 0 26px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}

.fm-publish-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4);
}

.fm-publish-submit:active {
    transform: scale(0.97);
}

/* ---- 分类标签栏 ---- */
.fm-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 6px 8px;
    margin-bottom: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    scrollbar-width: none;
}

.fm-tabs::-webkit-scrollbar {
    display: none;
}

.fm-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 12px 24px;
    color: var(--secondary);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    border: none;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.fm-tab:hover {
    color: var(--primary-container);
    background: var(--surface-container-low);
}

.fm-tab.active {
    color: var(--primary-container);
    background: linear-gradient(135deg, #ecf5ff 0%, #e3efff 100%);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(64, 158, 255, 0.18);
}

/* ---- 排序栏 ---- */
.fm-sort-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.fm-sort-link {
    font-size: 12px;
    color: #909399;
    text-decoration: none;
    transition: color 0.2s ease;
}

.fm-sort-link:hover,
.fm-sort-link.active {
    color: #409eff;
    font-weight: 600;
    text-decoration: none;
}

/* ---- 文章卡片 ---- */
.fm-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid #f0f0f0;
    margin-bottom: 20px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.fm-card:hover {
    border-color: rgba(64, 158, 255, 0.3);
}

.fm-card-body {
    padding: 18px 20px;
}

.fm-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.fm-card-author-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
    transition: opacity 0.2s ease;
}

.fm-card-author-link:hover {
    opacity: 0.85;
}

.fm-card-author-link:hover .fm-author-name {
    color: var(--primary-container);
}

.fm-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.fm-author-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--on-surface);
}

.fm-time {
    font-size: 12px;
    color: #a8abb2;
}

.fm-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--on-surface);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.fm-card-title:hover {
    color: var(--primary);
}

.fm-card-title .truncate-single {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

.fm-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
}

.fm-badge-top {
    background: var(--orange-light);
    color: var(--orange);
}

.fm-badge-essence {
    background: var(--red-light);
    color: var(--red);
}

.fm-badge-category {
    background: #f4f4f5;
    color: var(--secondary);
    font-weight: 600;
    transition: all 0.2s ease;
}

.fm-card:hover .fm-badge-category {
    background: rgba(64, 158, 255, 0.1);
    color: var(--primary-container);
}

.fm-card-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--on-surface-variant);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fm-card-desc.line-clamp-2 {
    -webkit-line-clamp: 2;
}

/* 图片网格 */
.fm-img-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.fm-img-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.fm-img-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.fm-img-grid-1 {
    grid-template-columns: 1fr;
    max-width: 300px;
}

.fm-img-item {
    aspect-ratio: 1 / 1.2;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.fm-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.fm-img-item:hover img {
    transform: scale(1.03);
}

.fm-img-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.fm-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.fm-card-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #909399;
    font-size: 13px;
}

.fm-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.fm-stat:hover {
    color: var(--primary);
}

.fm-stat .icon {
    font-size: 16px;
    line-height: 1;
}

/* ---- 右侧边栏 ---- */
.fm-widget {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid #f0f0f0;
    margin-bottom: 20px;
    overflow: hidden;
}

.fm-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
}

.fm-widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--on-surface);
}

.fm-widget-title .icon {
    font-size: 18px;
    color: var(--orange);
    line-height: 1;
}

.fm-widget-more {
    font-size: 12px;
    color: var(--primary-container);
    text-decoration: none;
}

.fm-widget-more:hover {
    text-decoration: underline;
}

.fm-rank-list {
    padding: 16px 8px;
}

.fm-rank-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.2s ease;
}

.fm-rank-item:hover {
    background: #f8fafc;
}

.fm-rank-num {
    font-size: 20px;
    font-weight: 900;
    font-style: italic;
    line-height: 1;
    margin-top: 2px;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.fm-rank-num.top1 { color: #ff6b35; }
.fm-rank-num.top2 { color: #ff9f43; }
.fm-rank-num.top3 { color: #feca57; }
.fm-rank-num.other { color: #c0c4cc; }

.fm-rank-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--on-surface);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
    transition: color 0.2s ease;
}

.fm-rank-item:hover .fm-rank-title {
    color: var(--primary);
}

.fm-widget-footer {
    padding: 12px;
    text-align: center;
    background: #fafbfc;
    font-size: 11px;
    color: #c0c4cc;
}

/* 推广卡片 */
.fm-promo {
    background: linear-gradient(135deg, #4f46e5, #9333ea);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: #fff;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

.fm-promo-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.fm-promo-desc {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 16px;
    line-height: 1.5;
}

.fm-promo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
}

.fm-promo-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 底部链接 */
.fm-footer-links {
    padding: 0 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.fm-footer-links a {
    font-size: 12px;
    color: #a8abb2;
    text-decoration: none;
    transition: color 0.2s ease;
}

.fm-footer-links a:hover {
    color: var(--primary);
}

.fm-footer-copy {
    font-size: 11px;
    color: #dcdfe6;
    margin-top: 8px;
    width: 100%;
}

/* ---- 空状态 ---- */
.fm-empty {
    text-align: center;
    padding: 60px 20px;
    color: #c0c4cc;
}

.fm-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.fm-empty-text {
    font-size: 14px;
    margin-bottom: 16px;
}

.fm-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    background: linear-gradient(135deg, #409eff, #36a3f7);
    color: #fff;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.fm-empty-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}

/* ---- 列表加载（与 task 一致） ---- */
.xgt-list-loader {
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.xgt-list-loader.is-visible {
    display: flex;
}

.xgt-list-loader:not(.is-append) {
    min-height: 120px;
    padding: 24px 0;
}

.xgt-list-loader.is-append {
    padding: 16px 0 8px;
}

.xgt-list-loader img {
    width: 24px;
    height: 24px;
    display: block;
}

.fm-load-more {
    display: flex;
    justify-content: center;
    padding: 20px 0 8px;
}

.fm-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 14px;
    color: var(--primary-container);
    background: #fff;
    border: 1px solid #dcdfe6;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.fm-load-more-btn:hover {
    color: #fff;
    background: var(--primary-container);
    border-color: var(--primary-container);
}

/* ---- 详情 / 编辑页 ---- */
.fm-detail-wrap {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.fm-detail-header {
    padding: 32px;
    border-bottom: 1px solid #f0f0f0;
}

.fm-detail-title-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.fm-detail-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--on-surface);
    flex: 1;
}

.fm-detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #909399;
    flex-wrap: wrap;
}

.fm-detail-meta a {
    color: var(--primary-container);
    text-decoration: none;
}

.fm-detail-content {
    padding: 32px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--on-surface);
}

.fm-detail-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

.fm-detail-actions {
    display: flex;
    gap: 12px;
    padding: 20px 32px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.fm-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e4e7ed;
    background: var(--surface);
    color: var(--secondary);
    text-decoration: none;
}

.fm-action-btn:hover {
    border-color: var(--primary-container);
    color: var(--primary-container);
}

.fm-action-btn.liked {
    background: var(--red-light);
    border-color: var(--red);
    color: var(--red);
}

/* 回复区域 */
.fm-replies-section {
    padding: 32px;
    border-top: 1px solid #f0f0f0;
}

.fm-replies-header {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--on-surface);
}

.fm-reply-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #f5f5f5;
}

.fm-reply-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.fm-reply-content-wrap {
    flex: 1;
    min-width: 0;
}

.fm-reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.fm-reply-author {
    font-size: 14px;
    font-weight: 700;
    color: var(--on-surface);
    text-decoration: none;
}

.fm-reply-author:hover {
    color: var(--primary);
}

.fm-author-badge {
    display: inline-block;
    padding: 1px 6px;
    background: var(--primary-container);
    color: #fff;
    font-size: 11px;
    border-radius: 3px;
    font-weight: 600;
}

.fm-reply-time {
    font-size: 12px;
    color: #c0c4cc;
}

.fm-reply-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--on-surface-variant);
    margin-bottom: 10px;
    word-break: break-word;
}

.fm-reply-to {
    color: var(--primary-container);
    font-size: 14px;
}

.fm-reply-actions {
    display: flex;
    gap: 16px;
}

.fm-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #909399;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.fm-reply-btn:hover {
    color: var(--primary);
}

.fm-sub-replies {
    margin-top: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
}

.fm-sub-reply-item {
    padding: 8px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--on-surface-variant);
    border-bottom: 1px solid #f0f0f0;
}

.fm-sub-reply-item:last-child {
    border-bottom: none;
}

.fm-sub-reply-author {
    font-weight: 700;
    color: var(--on-surface);
    text-decoration: none;
}

.fm-sub-reply-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 12px;
    color: #c0c4cc;
}

/* 回复编辑器 */
.fm-reply-editor {
    padding: 32px;
    border-top: 1px solid #f0f0f0;
}

.fm-reply-editor-header {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--on-surface);
}

.fm-reply-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #e4e7ed;
    border-radius: var(--radius-sm);
    font-size: 13px;
    resize: vertical;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.fm-reply-textarea:focus {
    border-color: var(--primary-container);
    box-shadow: var(--focus-ring);
}

.fm-reply-submit-wrap {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.fm-btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    border: 1px solid #dcdfe6;
    background: var(--surface);
    color: var(--secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fm-btn-cancel:hover {
    border-color: var(--primary-container);
    color: var(--primary);
}

.fm-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    background: linear-gradient(135deg, #409eff, #36a3f7);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}

/* 登录提示 */
.fm-login-prompt {
    text-align: center;
    padding: 40px;
    color: #909399;
}

.fm-guest-publish-tip {
    color: #909399;
    font-size: 14px;
    margin: 0;
}

/* 未登录发布区（高度与已登录发布卡片视觉平衡） */
.fm-publish-card--guest {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 132px;
    padding: 28px 24px;
    text-align: center;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    border-color: #e8edf3;
}

.fm-guest-publish-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 360px;
}

.fm-guest-publish-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(64, 158, 255, 0.1);
    color: #409eff;
    font-size: 20px;
    line-height: 1;
}

.fm-publish-card--guest .fm-guest-publish-tip {
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
}

.fm-guest-publish-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 20px;
    border-radius: 4px;
    background: #409eff;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.25);
}

.fm-guest-publish-btn:hover {
    background: #66b1ff;
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.35);
    transform: translateY(-1px);
}

/* ---- 表单（发帖/编辑） ---- */
.fm-form-group {
    margin-bottom: 20px;
}

.fm-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--on-surface);
    margin-bottom: 8px;
}

.fm-form-group .required::after {
    content: '*';
    color: var(--red);
    margin-left: 4px;
}

.fm-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dcdfe6;
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--on-surface);
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.fm-form-control:focus {
    border-color: var(--primary-container);
    box-shadow: var(--focus-ring);
}

.fm-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* ---- 图片上传预览 ---- */
.fm-upload-preview {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.fm-upload-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid #e4e7ed;
}

.fm-upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-upload-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fm-upload-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

.fm-upload-btn {
    position: relative;
}

/* ---- 标题弹框 ---- */
.fm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-dialog {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
}

.fm-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.fm-dialog-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--on-surface);
    margin: 0;
}

.fm-dialog-close {
    font-size: 24px;
    color: #909399;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.fm-dialog-close:hover {
    color: var(--primary);
}

.fm-dialog-body {
    padding: 24px;
}

.fm-dialog-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e4e7ed;
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--on-surface);
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.fm-dialog-input:focus {
    border-color: var(--primary-container);
    box-shadow: var(--focus-ring);
}

.fm-dialog-hint {
    font-size: 12px;
    color: #909399;
    margin-top: 8px;
    margin-bottom: 0;
}

.fm-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
}

.fm-dialog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.fm-dialog-btn-cancel {
    background: var(--surface);
    color: var(--secondary);
    border: 1px solid #dcdfe6;
}

.fm-dialog-btn-cancel:hover {
    border-color: var(--primary-container);
    color: var(--primary);
}

.fm-dialog-btn-primary {
    background: linear-gradient(135deg, #409eff, #36a3f7);
    color: #fff;
}

.fm-dialog-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}
/* ---- Jodit 发帖/编辑 ---- */
.fm-jodit-wrap {
    min-height: 320px;
}

.fm-jodit-wrap .jodit-container {
    border-radius: var(--radius);
    border-color: #e8ecf1;
}

.fm-jodit-wrap .jodit-container:focus-within {
    border-color: var(--primary-container);
    box-shadow: var(--focus-ring);
}

.fm-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- 响应式 ---- */
@media (max-width: 1280px) {
    .fm-sidebar-right {
        display: none;
    }
}

@media (max-width: 1024px) {
    .fm-sidebar-left {
        display: none;
    }

    .fm-main {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .fm-layout {
        padding: 20px 16px 32px;
    }

    .fm-publish-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .fm-publish-submit-wrap {
        width: 100%;
        justify-content: flex-end;
    }

    .fm-publish-select {
        min-width: 110px;
        max-width: none;
        flex: 1;
    }

    .fm-card-body {
        padding: 16px;
    }

    .fm-img-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fm-tabs {
        padding: 0 4px;
    }

    .fm-tab {
        padding: 0 10px;
        font-size: 12px;
    }

    .fm-publish-card--guest {
        min-height: 120px;
        padding: 24px 16px;
    }

    .fm-guest-publish-inner {
        gap: 10px;
    }

    .fm-detail-title {
        font-size: 18px;
    }

    .fm-detail-header {
        padding: 16px 20px;
    }

    .fm-detail-content,
    .fm-replies-section,
    .fm-reply-editor {
        padding: 20px 16px;
    }
}
