/* ===== Forum 全屏适配修复 ===== */
#forumApp {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: none; /* 默认隐藏，showPage 会控制 */
    flex-direction: column;
    background: #fff;
}

#forumApp[style*="display: flex"],
#forumApp.active {
    display: flex !important;
}

.forum-app {
    background-color: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    color: #333;
}

.forum-header {
    background: rgba(255,255,255,0.95);
    color: #333;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    backdrop-filter: blur(10px);
        flex-shrink: 0;

    position: sticky;
    top: 0;
    z-index: 100;
}

.forum-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.forum-search-bar {
    flex: 1;
    margin: 0 15px;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    color: #999;
}

.forum-search-bar input {
    border: none;
    background: transparent;
    margin-left: 10px;
    width: 100%;
    outline: none;
    color: #333;
}

.forum-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: white;
    display: flex !important;
    justify-content: space-around;
    align-items: center;
    min-height: 50px;
    padding: 10px 0;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: none;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.03);
    border-radius: 20px 20px 0 0;
    z-index: 9999 !important;
    flex-shrink: 0;
}


.forum-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.forum-nav-item.active {
    color: #333;
    font-weight: bold;
}

.forum-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

/* ---- 上方是：.forum-nav-item i { font-size: 20px; margin-bottom: 4px; } ---- */

.forum-nav.nav-hidden {
    display: none !important;
}

/* ---- 下方是：.forum-content { flex: 1; ... } ---- */

.forum-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px));
}


.forum-page {
    display: none;
}

.forum-post {
    background: white;
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #f8f8f8;
    transition: transform 0.2s;
}

.forum-post:active {
    transform: scale(0.98);
}

.forum-post-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.forum-post-meta {
    font-size: 13px;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forum-board-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.forum-market-item {
    background: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 16px;
    display: flex;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.forum-market-img {
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    background-size: cover;
    border-radius: 12px;
}

/* Post Detail */
/* Post Detail - 修改此处 */
.forum-detail-modal {
    position: fixed !important; /* 强制填满屏幕 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    /* 核心修改：层级设为10000，原本的导航栏是9999，这样页面就会盖住导航栏 */
    z-index: 10000 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止双重滚动 */
}


.forum-comment {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
}

/* Chat */
.chat-item {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #f8f8f8;
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    font-size: 20px;
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-weight: bold;
    font-size: 16px;
}

.chat-msg {
    color: #999;
    font-size: 14px;
    margin-top: 4px;
}

/* Generate Button (Top Right or Floating) */
/* 右上角小图标按钮 */
.forum-header-icon {
    font-size: 18px;
    color: #333;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

.forum-header-icon:active {
    color: #666;
}


.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: auto !important;
  z-index: 9999 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: auto !important;
  background: inherit;
}

/* 隐藏body滚动条防止双滚动条 */
body.has-fullscreen {
  overflow: hidden !important;
}
