/* ============================================
   Forum 论坛 — White Frosted Glass Style
   ============================================ */

/* ===== 全屏遮罩 ===== */
.forum-overlay {
    position: absolute;
    inset: 0;
    z-index: 200;
    border-radius: 44px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s, visibility .35s;
    pointer-events: none;
    --keyboard-offset: 0px;
    --keyboard-bottom-space: 0px;
}

.forum-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.forum-overlay.keyboard-managed,
.fm-app.keyboard-managed,
.fm-modal.keyboard-managed {
    overflow: hidden;
}

/* ===== 主容器 ===== */
.fm-app {
    position: absolute;
    inset: 0;
    background: rgba(246, 246, 248, .92);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    display: flex;
    flex-direction: column;
    border-radius: 44px;
    overflow: hidden;
    font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', sans-serif;
}

/* ===== 顶栏 ===== */
.fm-topbar {
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: .5px solid rgba(0, 0, 0, .04);
}

.fm-topbar-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: .3px;
}

.fm-topbar-btns {
    display: flex;
    gap: 6px;
    align-items: center;
}

.fm-topbar-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .04);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s;
}

.fm-topbar-btn:active {
    transform: scale(.9);
    background: rgba(0, 0, 0, .08);
}

.fm-topbar-btn svg {
    width: 15px;
    height: 15px;
    stroke: #555;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===== 滚动内容区 ===== */
.fm-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 70px;
}

.fm-body::-webkit-scrollbar {
    width: 0;
}

/* ===== 底部Dock ===== */
.fm-dock {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 28px;
    padding: 6px 8px;
    border: .5px solid rgba(255, 255, 255, .6);
    box-shadow: 0 2px 16px rgba(0, 0, 0, .06), 0 0 0 .5px rgba(0, 0, 0, .03);
    z-index: 10;
}

.fm-dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 16px 4px;
    border-radius: 20px;
    cursor: pointer;
    transition: all .15s;
    min-width: 52px;
}

.fm-dock-item:active {
    transform: scale(.92);
}

.fm-dock-item.active {
    background: rgba(0, 0, 0, .06);
}

.fm-dock-item svg {
    width: 20px;
    height: 20px;
    stroke: #999;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke .15s;
}

.fm-dock-item.active svg {
    stroke: #333;
}

.fm-dock-label {
    font-size: 8px;
    color: #aaa;
    letter-spacing: .5px;
    font-weight: 600;
    transition: color .15s;
}

.fm-dock-item.active .fm-dock-label {
    color: #555;
}

/* ===== 帖子卡片 ===== */
.fm-post-card {
    background: rgba(255, 255, 255, .5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 8px 14px;
    border-radius: 16px;
    padding: 14px 16px;
    border: .5px solid rgba(255, 255, 255, .6);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .02);
    cursor: pointer;
    transition: all .15s;
}

.fm-post-card:active {
    transform: scale(.98);
    background: rgba(255, 255, 255, .65);
}

.fm-post-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.fm-post-nick {
    font-size: 11px;
    font-weight: 600;
    color: #444;
}

.fm-post-forum-tag {
    font-size: 9px;
    color: #999;
    background: rgba(0, 0, 0, .03);
    padding: 2px 8px;
    border-radius: 10px;
}

.fm-post-time {
    font-size: 9px;
    color: #bbb;
    margin-left: auto;
}

.fm-post-title {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    line-height: 1.4;
}

.fm-post-preview {
    font-size: 11px;
    color: #888;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fm-post-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.fm-post-stat {
    font-size: 9px;
    color: #bbb;
    display: flex;
    align-items: center;
    gap: 3px;
}

.fm-post-stat svg {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===== 关注列表 ===== */
.fm-forum-card {
    background: rgba(255, 255, 255, .5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin: 8px 14px;
    border-radius: 16px;
    padding: 14px 16px;
    border: .5px solid rgba(255, 255, 255, .6);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all .15s;
}

.fm-forum-card:active {
    transform: scale(.98);
}

.fm-forum-av {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .04);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-forum-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-forum-av svg {
    width: 20px;
    height: 20px;
    stroke: #ccc;
    stroke-width: 1.5;
    fill: none;
}

.fm-forum-info {
    flex: 1;
    min-width: 0;
}

.fm-forum-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
}

.fm-forum-motto {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fm-forum-arrow {
    color: #ccc;
    font-size: 14px;
}

/* 创建按钮 */
.fm-create-btn {
    margin: 12px 14px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .04);
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    letter-spacing: .5px;
    cursor: pointer;
    transition: all .15s;
}

.fm-create-btn:active {
    background: rgba(0, 0, 0, .08);
    transform: scale(.97);
}

/* ===== 个人主页 '我' ===== */
.fm-profile {
    padding: 20px 18px 12px;
    text-align: center;
}

.fm-profile-av {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, .7);
    margin: 0 auto 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, .04);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.fm-profile-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-profile-av svg {
    width: 28px;
    height: 28px;
    stroke: #ccc;
    stroke-width: 1.5;
    fill: none;
}

.fm-profile-name-en {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    letter-spacing: .3px;
}

.fm-profile-name-cn {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.fm-profile-bio {
    font-size: 10px;
    color: #aaa;
    margin-top: 6px;
    line-height: 1.5;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
    cursor: pointer;
}

.fm-profile-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 12px;
}

.fm-profile-stat-num {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

.fm-profile-stat-label {
    font-size: 9px;
    color: #999;
    letter-spacing: .5px;
}

/* 我的帖子 / 互动 横排板块 */
.fm-me-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 14px 4px;
}

.fm-me-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .45);
    border: .5px solid rgba(255, 255, 255, .5);
    cursor: pointer;
    transition: all .15s;
}

.fm-me-tab:active {
    transform: scale(.96);
}

.fm-me-tab.active {
    background: rgba(0, 0, 0, .05);
}

.fm-me-tab svg {
    width: 16px;
    height: 16px;
    stroke: #888;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fm-me-tab span {
    font-size: 10px;
    font-weight: 600;
    color: #666;
    letter-spacing: .5px;
}

/* ===== 论坛详情页 ===== */
.fm-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: .5px solid rgba(0, 0, 0, .04);
}

.fm-detail-av {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 0, 0, .04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fm-detail-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fm-detail-av svg {
    width: 22px;
    height: 22px;
    stroke: #ccc;
    stroke-width: 1.5;
    fill: none;
}

.fm-detail-info {
    flex: 1;
}

.fm-detail-name {
    font-size: 14px;
    font-weight: 700;
    color: #222;
}

.fm-detail-type {
    font-size: 9px;
    color: #999;
    margin-top: 2px;
}

.fm-detail-desc {
    padding: 8px 16px 12px;
    font-size: 10px;
    color: #999;
    line-height: 1.6;
    border-bottom: .5px solid rgba(0, 0, 0, .04);
}

/* ===== 帖子详情页 ===== */
.fm-pdetail-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    padding: 16px 16px 4px;
    line-height: 1.4;
}

.fm-pdetail-meta {
    padding: 4px 16px 12px;
    font-size: 10px;
    color: #bbb;
    display: flex;
    gap: 10px;
}

.fm-pdetail-body {
    padding: 0 16px 16px;
    font-size: 12px;
    color: #444;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.fm-pdetail-actions {
    display: flex;
    gap: 12px;
    padding: 8px 16px 14px;
    border-bottom: .5px solid rgba(0, 0, 0, .04);
}

.fm-pdetail-action {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(0, 0, 0, .03);
    font-size: 10px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all .15s;
}

.fm-pdetail-action:active {
    transform: scale(.94);
    background: rgba(0, 0, 0, .06);
}

.fm-pdetail-action.liked {
    color: #e55;
}

.fm-pdetail-action svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 评论区 */
.fm-comments-title {
    padding: 12px 16px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #555;
    letter-spacing: .5px;
}

.fm-comment {
    padding: 10px 16px;
    border-bottom: .5px solid rgba(0, 0, 0, .03);
}

.fm-comment-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.fm-comment-nick {
    font-size: 10px;
    font-weight: 600;
    color: #555;
}

.fm-comment-time {
    font-size: 9px;
    color: #ccc;
    margin-left: auto;
}

.fm-comment-text {
    font-size: 11px;
    color: #666;
    line-height: 1.6;
}

/* 评论输入 */
.fm-comment-bar {
    position: absolute;
    bottom: 16px;
    left: 14px;
    right: 14px;
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 22px;
    padding: 6px 6px 6px 14px;
    border: .5px solid rgba(255, 255, 255, .5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}

.fm-app.keyboard-active .fm-body {
    padding-bottom: 70px;
    scroll-padding-bottom: 24px;
}

.fm-app.keyboard-active,
.fm-app.keyboard-active .fm-comment-bar,
.fm-modal.keyboard-active {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.fm-comment-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 11px;
    color: #333;
    font-family: inherit;
}

.fm-comment-input::placeholder {
    color: #ccc;
}

.fm-comment-send {
    padding: 6px 14px;
    border-radius: 18px;
    background: rgba(0, 0, 0, .06);
    font-size: 9px;
    font-weight: 700;
    color: #666;
    letter-spacing: .5px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.fm-comment-send:active {
    transform: scale(.92);
    background: rgba(0, 0, 0, .1);
}

/* ===== 创建论坛弹窗 ===== */
.fm-modal-overlay {
    position: absolute;
    inset: 0;
    z-index: 210;
    background: rgba(0, 0, 0, .2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fm-modal {
    width: 100%;
    max-width: 320px;
    max-height: 80vh;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 22px;
    border: .5px solid rgba(255, 255, 255, .6);
    box-shadow: 0 8px 40px rgba(0, 0, 0, .08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.fm-modal-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: .5px solid rgba(0, 0, 0, .04);
}

.fm-modal-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.fm-modal-close {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: .4;
}

.fm-modal-close:active {
    opacity: .7;
}

.fm-modal-close svg {
    width: 13px;
    height: 13px;
    stroke: #555;
    stroke-width: 2;
    fill: none;
}

.fm-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 18px;
    -webkit-overflow-scrolling: touch;
}

.fm-modal-body::-webkit-scrollbar {
    width: 0;
}

.fm-field {
    margin-bottom: 12px;
}

.fm-field-label {
    font-size: 9px;
    font-weight: 700;
    color: #999;
    letter-spacing: .8px;
    margin-bottom: 6px;
}

.fm-field-input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 12px;
    border: .5px solid rgba(0, 0, 0, .06);
    background: rgba(255, 255, 255, .5);
    font-size: 12px;
    color: #333;
    outline: none;
    font-family: inherit;
    transition: border-color .2s;
}

.fm-field-input:focus {
    border-color: rgba(0, 0, 0, .12);
}

.fm-field-textarea {
    width: 100%;
    min-height: 60px;
    padding: 9px 12px;
    border-radius: 12px;
    border: .5px solid rgba(0, 0, 0, .06);
    background: rgba(255, 255, 255, .5);
    font-size: 11px;
    color: #333;
    outline: none;
    font-family: inherit;
    resize: vertical;
}

.fm-field-textarea:focus {
    border-color: rgba(0, 0, 0, .12);
}

/* 角色选择器 */
.fm-char-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fm-char-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, .04);
    font-size: 10px;
    color: #666;
    cursor: pointer;
    transition: all .15s;
}

.fm-char-chip:active {
    transform: scale(.94);
}

.fm-char-chip.selected {
    background: rgba(0, 0, 0, .1);
    color: #333;
    font-weight: 600;
}

.fm-char-chip img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
}

.fm-modal-submit {
    margin-top: 6px;
    padding: 11px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .07);
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #555;
    letter-spacing: .5px;
    cursor: pointer;
    transition: all .15s;
}

.fm-modal-submit:active {
    transform: scale(.96);
    background: rgba(0, 0, 0, .12);
}

/* ===== 发帖弹窗 ===== */
.fm-publish-av {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .04);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.fm-publish-av img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== 空状态 ===== */
.fm-empty {
    padding: 40px 20px;
    text-align: center;
}

.fm-empty-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    opacity: .15;
}

.fm-empty-icon svg {
    width: 100%;
    height: 100%;
    stroke: #888;
    stroke-width: 1.2;
    fill: none;
}

.fm-empty-text {
    font-size: 11px;
    color: #bbb;
    line-height: 1.6;
}

/* loading */
.fm-loading {
    padding: 30px;
    text-align: center;
    font-size: 10px;
    color: #ccc;
    letter-spacing: 1px;
}

/* 分割线标题 */
.fm-section-label {
    padding: 14px 18px 6px;
    font-size: 9px;
    font-weight: 700;
    color: #bbb;
    letter-spacing: 1.2px;
}

/* 翻译按钮 */
.fm-trans-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #888;
    cursor: pointer;
    padding: 2px 8px;
    margin: 4px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
    width: fit-content;
}

.fm-trans-btn:hover {
    color: #4fc3f7;
    border-color: rgba(79, 195, 247, 0.3);
    background: rgba(79, 195, 247, 0.05);
}

.fm-trans-btn svg {
    fill: currentColor;
    stroke: none;
}

.fm-trans-btn-sm {
    font-size: 9px;
    padding: 1px 6px;
}

/* 翻译结果块 */
.fm-trans-block {
    margin: 4px 0 8px 0;
    padding: 8px 10px;
    background: rgba(79, 195, 247, 0.06);
    border-left: 2px solid rgba(79, 195, 247, 0.3);
    border-radius: 0 6px 6px 0;
    font-size: 11px;
    line-height: 1.5;
    color: #b0b0b0;
}

.fm-trans-label {
    font-size: 9px;
    color: #4fc3f7;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.fm-trans-text {
    color: #ccc;
}

.fm-trans-loading {
    color: #888;
    font-size: 10px;
    animation: fmBlink 1s infinite;
}

@keyframes fmBlink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.3
    }
}

/* ======================
   论坛：方角铺满
   ====================== */

/* 论坛overlay容器：去掉圆角、铺满 */
#forumOverlay {
    border-radius: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* 论坛内部fm-app也方角铺满 */
#forumOverlay .fm-app {
    border-radius: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
}

/* 论坛顶栏方角 */
#forumOverlay .fm-topbar {
    border-radius: 0 !important;
}

/* 底部导航栏方角 */
#forumOverlay .fm-dock {
    border-radius: 0 !important;
}
