/* ChemTop Forum - Modern Community Styles */

:root {
    --forum-primary: #1565C0;
    --forum-secondary: #4FC3F7;
    --forum-accent: #00C853;
    /* Emerald Green */
    --forum-bg: #f8fafc;
    --forum-sidebar: #ffffff;
    --forum-text-main: #1e293b;
    --forum-text-sub: #64748b;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

body.forum-page {
    background-color: var(--forum-bg);
    color: var(--forum-text-main);
    padding-top: 40px;
    /* Navbar height (30px) + spacing (10px) */
}

.forum-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 10px 2%;
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    gap: 20px;
    box-sizing: border-box;
}

/* Sidebar Navigation */
.forum-nav {
    position: sticky;
    top: 50px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    background: white;
    padding: 8px 10px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 8px;
}

.nav-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--forum-text-sub);
    letter-spacing: 0.05em;
    padding: 0 4px 5px;
    border-bottom: 1px solid #f1f5f9;
}

.forum-menu {
    list-style: none;
    padding: 4px 0 0;
}

.forum-menu-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: var(--forum-text-main);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-weight: 500;
}

.forum-menu-item a:hover {
    background: #eff6ff;
    color: var(--forum-primary);
}

.forum-menu-item.active a {
    background: var(--forum-primary);
    color: white;
}

/* Content Stream */
.forum-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-bar-inline {
    background: white;
    padding: 10px 15px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-bar-inline input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--forum-text-main);
}

/* Post Card - Refactored for Mobile & Flexbox */
/* Post Card - Hybrid Layout (Absolute for Desktop, Flex for Mobile) */
.post-card {
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    /* Essential for absolute positioning children */
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

/* 1. Header: Tags */
.post-card .post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
    padding: 0;
    margin: 0;
    /* Desktop: Reserve space on the right for Meta & Stats */
    padding-right: 360px;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.tag {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 99px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Tag Colors */
.tag-sim {
    background: #e0f2fe;
    color: #0284c7;
}

.tag-equip {
    background: #fff7ed;
    color: #c2410c;
}

.tag-safety {
    background: #fef2f2;
    color: #dc2626;
}

.tag-help {
    background: #ecfdf5;
    color: #059669;
}

.tag-pin {
    background: #f3f4f6;
    color: #4b5563;
}

/* 2. Body: Title */
.post-body {
    flex: 1;
}

.post-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--forum-text-main);
    line-height: 1.5;
    margin: 0;
}

/* 3. Footer: Meta & Stats (Desktop Absolute Layout) */
.post-footer {
    display: flex;
    align-items: center;
    gap: 16px;

    /* Absolute Positioning for Desktop */
    position: absolute;
    top: 16px;
    /* Matches card padding-top */
    right: 20px;
    /* Matches card padding-right */
    width: auto;

    padding: 0;
    margin: 0;
    border: none;
    justify-content: flex-end;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--forum-text-sub);
    font-size: 0.85rem;
    position: static;
    width: auto;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #475569;
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px white, 0 0 0 2px #e2e8f0;
}

.post-time {
    color: #94a3b8;
    font-size: 0.8rem;
}

.post-stats {
    display: flex;
    gap: 16px;
    align-items: center;
    position: static;
    width: auto;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.stat-item:hover {
    color: var(--forum-primary);
}

/* Right Sidebar Widget */
.widget {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-list {
    list-style: none;
}

.help-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.rank-num {
    width: 24px;
    height: 24px;
    background: #f1f5f9;
    color: var(--forum-text-sub);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.rank-num.top1 {
    background: #fef3c7;
    color: #d97706;
}

/* Responsive */
@media (max-width: 1200px) {
    .forum-container {
        grid-template-columns: 200px 1fr 260px;
    }
}

@media (max-width: 1024px) {
    .forum-container {
        grid-template-columns: 180px 1fr;
        max-width: 1000px;
        padding: 16px 3%;
    }

    .widget-area {
        display: none;
    }
}

/* --- Skeleton Loading Animation --- */
@keyframes skeleton-loading {
    0% {
        background-color: #f1f5f9;
        opacity: 0.7;
    }

    50% {
        background-color: #cbd5e1;
        opacity: 1;
    }

    100% {
        background-color: #f1f5f9;
        opacity: 0.7;
    }
}

.skeleton {
    animation: skeleton-loading 1.5s infinite ease-in-out;
    border-radius: 4px;
    background-color: #f1f5f9;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 12px;
    width: 60%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-meta {
    width: 100px;
    height: 14px;
}

.skeleton-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .forum-container {
        display: block !important;
        /* Kill Grid */
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        /* Allow cards to decide padding or use consistent margin */
        margin: 0 !important;
    }

    .forum-nav {
        display: none !important;
    }

    .forum-feed {
        width: 100% !important;
        max-width: none !important;
        padding: 10px 8px;
        /* Safe space from screen edges */
        box-sizing: border-box;
        gap: 12px;
    }

    .widget-area {
        display: none !important;
    }

    /* 隐藏桌面版导航菜单，只显示汉堡菜单 */
    .navbar .nav-menu {
        display: none !important;
    }
}

/* 附件上传区域样式 */
.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    background: white;
    transition: 0.3s;
    cursor: pointer;
    margin-bottom: 15px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #1565C0;
    background: #f0f9ff;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.upload-text {
    color: #64748b;
    font-size: 0.9rem;
}

.attachment-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
}

.upload-item .file-info {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-item .btn-remove {
    color: #f43f5e;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
}

.upload-item.uploading {
    border-color: #38bdf8;
    background: #f0f9ff;
}

.progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #1565C0;
    width: 0%;
    transition: width 0.3s;
}

/* 搜索和排序样式 */
.sort-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.sort-btn:hover {
    border-color: #1565C0;
    color: #1565C0;
}

.sort-btn.active {
    background: #1565C0;
    border-color: #1565C0;
    color: white;
}

.search-history-dropdown {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.search-history-item {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.search-history-item:hover {
    background: #f1f5f9;
}

.search-history-item .keyword {
    font-size: 0.9rem;
    color: #334155;
}

.search-history-item .time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.search-history-item .clear-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    color: #f43f5e;
    cursor: pointer;
}

.search-history-item .clear-btn:hover {
    background: #fee2e2;
    border-radius: 4px;
}

.search-highlight {
    background: #fef08a;
    padding: 0 2px;
    border-radius: 2px;
}

/* 排序按钮激活状态 */
.sort-btn[data-sort="hot"].active {
    background: #f43f5e;
    border-color: #f43f5e;
}

.sort-btn[data-sort="essence"].active {
    background: #f59e0b;
    border-color: #f59e0b;
}

.sort-btn[data-sort="latest"].active {
    background: #1565C0;
    border-color: #1565C0;
}

/* 搜索信息栏 */
.search-info {
    padding: 8px 0;
    color: #64748b;
    font-size: 0.85rem;
}

.search-info .highlight {
    color: #1565C0;
    font-weight: 600;
}

/* 加载更多按钮 */
.load-more-container {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.load-more-btn {
    display: inline-block;
    padding: 12px 40px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: #f8fafc;
    border-color: #1565C0;
    color: #1565C0;
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 加载状态 */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #64748b;
}

/* 无限滚动加载提示 */
.scroll-loading {
    text-align: center;
    padding: 15px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.scroll-loading.show {
    display: block;
}

/* ==================== 移动端响应式优化 ==================== */

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    margin: 5px 0;
    transition: all 0.3s;
    border-radius: 2px;
}

/* 移动端遮罩层 - 默认必须隐藏 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1090;
    /* 略低于 Sidebar (1091+) */
    backdrop-filter: blur(2px);
}

.mobile-overlay.show {
    display: block !important;
}

/* 移动端侧边栏 - 默认隐藏在屏幕外 */
.mobile-sidebar {
    display: block !important;
    /* 这里要 block，靠 left 来隐藏 */
    position: fixed;
    top: 0;
    left: -285px;
    /* 给点余量 */
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    background: white;
    z-index: 1099;
    /* 确保在所有内容之上 */
    padding: 8px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
}

.mobile-sidebar.open {
    left: 0 !important;
}

/* 小屏幕设备 (320px - 480px) */
@media (max-width: 480px) {

    /* 1. Global Container Adjustments */
    .forum-container {
        padding: 8px 10px;
        gap: 10px;
    }

    /* 2. Compact Post Card */
    .post-card {
        padding: 12px;
        gap: 8px;
        /* Tighter vertical spacing */
    }

    /* Header: Compact Tags */
    .post-card .post-header {
        margin-bottom: 4px;
        padding-right: 0;
        /* Reset desktop padding */
    }

    .post-tags {
        gap: 6px;
    }

    .tag {
        font-size: 0.65rem;
        padding: 2px 8px;
        height: 20px;
        line-height: 16px;
    }

    /* Body: Title optimization */
    .post-title {
        font-size: 0.95rem;
        font-weight: 600;
        line-height: 1.4;
        margin-bottom: 2px;
    }

    /* Footer: Horizontal Layout (Critical Fix) */
    .post-footer {
        position: static;
        /* Override desktop absolute */
        width: 100%;
        margin-top: 8px;
        padding-right: 0;
        border: none;

        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        padding-top: 8px;
        border-top: 1px solid #f8fafc;
        gap: 0;
    }

    .post-meta {
        font-size: 0.7rem;
        width: auto;
        flex: 1;
        /* Take left space */
        min-width: 0;
        /* Allow shrinking */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
        gap: 6px;
        color: #94a3b8;
    }

    .post-author {
        display: flex;
        align-items: center;
        gap: 4px;
        max-width: 55%;
        /* Limit name width */
    }

    .post-author a {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #64748b !important;
    }

    .author-avatar {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }

    .post-time {
        font-size: 0.7rem;
        flex-shrink: 0;
    }

    /* Remove file icon in mobile list to save space */
    .post-meta span[style*="📂"] {
        display: none;
    }

    /* Stats: Right aligned */
    .post-stats {
        width: auto;
        justify-content: flex-end;
        gap: 12px;
        flex-shrink: 0;
        margin: 0;
    }

    .action-btn {
        font-size: 0.7rem !important;
    }

    /* 3. Search Bar Optimization */
    .search-bar-inline {
        padding: 8px 12px;
        flex-wrap: nowrap;
        /* Don't wrap search/sort */
        gap: 8px;
        overflow-x: auto;
        /* Allow horizontal scroll for buttons if needed */
        -webkit-overflow-scrolling: touch;
    }

    .search-bar-inline::-webkit-scrollbar {
        display: none;
    }

    #forumSearchInput {
        min-width: 100px;
        font-size: 0.85rem;
    }

    .sort-options {
        flex-shrink: 0;
    }

    .sort-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
    }

    .publish-btn {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    /* 4. Navbar & Menu Fixes */
    /* Handled by mobile-menu.css, but add safety overrides here */
    .nav-section {
        padding: 10px;
    }

    .nav-section h3 {
        font-size: 0.75rem;
        padding: 0 8px 8px;
    }

    .forum-menu-item a {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .load-more-btn {
        padding: 8px 24px;
        font-size: 0.8rem;
    }

    /* 详情页移动端 */
    .post-content-full {
        padding: 16px;
        border-radius: 12px;
    }

    .post-content-full h1 {
        font-size: 1.2rem;
    }

    .post-body {
        font-size: 0.95rem;
    }

    .comments-section {
        padding: 16px;
        border-radius: 12px;
    }

    .comment-card {
        padding: 12px 0;
    }

    .comment-textarea {
        height: 80px;
        padding: 10px;
    }

    /* 用户主页移动端 */
    .profile-header {
        padding: 20px 15px;
    }

    .profile-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .profile-name {
        font-size: 1.1rem;
    }

    .profile-stats {
        gap: 15px;
    }

    .stat-item {
        padding: 8px 12px;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    /* 消息页面移动端 */
    .messages-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 100px);
        /* Fixed height */
        min-height: auto;
        display: flex;
        flex-direction: column;
    }

    .messages-sidebar {
        height: auto;
        max-height: 40%;
        border-radius: 12px;
        margin-bottom: 10px;
        flex-shrink: 0;
    }

    .messages-main {
        flex: 1;
        border-radius: 12px;
        height: auto;
    }

    .message-input-area {
        padding: 10px;
    }
}

/* ==================== 终极响应式重置 (Ultimate Responsive Reset) ==================== */

/* 1. 平板与手机通用重置 (768px 及以下) */
@media (max-width: 768px) {
    .forum-container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .forum-nav,
    .widget-area {
        display: none !important;
    }

    .forum-feed {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px !important;
        box-sizing: border-box !important;
    }

    /* 搜索栏强制占满 */
    .search-bar-inline {
        width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 10px !important;
        border-radius: 12px !important;
    }

    /* 帖子卡片强制占满并修复内联样式干扰 */
    .post-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 10px 0 !important;
        padding: 12px !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
    }

    .post-card .post-header {
        padding-right: 0 !important;
        /* 彻底清除桌面端留空 */
        margin-bottom: 6px !important;
    }

    .post-title {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        width: 100% !important;
    }

    .post-footer {
        position: static !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-top: 10px !important;
        margin-top: 8px !important;
        border-top: 1px solid #f1f5f9 !important;
    }

    .post-meta {
        font-size: 0.75rem !important;
        flex: 1 !important;
        overflow: hidden !important;
    }

    .post-stats {
        flex-shrink: 0 !important;
        gap: 12px !important;
    }
}

/* 2. 手机端深度优化 (480px 及以下) */
@media (max-width: 480px) {
    .forum-feed {
        padding: 6px !important;
    }

    .post-card {
        padding: 10px !important;
        border-radius: 10px !important;
    }

    .post-title {
        font-size: 0.95rem !important;
    }

    .post-author a {
        max-width: 80px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }

    .author-avatar {
        width: 22px !important;
        height: 22px !important;
    }

    .action-btn {
        font-size: 0.7rem !important;
    }

    /* 状态栏按钮紧凑化 */
    .post-stats {
        gap: 8px !important;
    }
}

/* 3. 中大屏幕适配保持 */
@media (min-width: 769px) and (max-width: 1024px) {
    .forum-container {
        grid-template-columns: 180px 1fr;
        padding: 16px 2%;
    }

    .widget-area {
        display: none;
    }
}

@media (max-width: 768px) {
    .mobile-sidebar {
        padding: 8px 12px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .mobile-user-section {
        background: linear-gradient(135deg, #1565C0 0%, #0284c7 100%);
        padding: 12px 14px;
        margin: -8px -12px 10px -12px;
        color: white;
    }

    .mobile-user-info {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
    }

    .mobile-avatar-placeholder {
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(4px);
        border: 1.5px solid rgba(255, 255, 255, 0.4);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
        font-weight: bold;
        flex-shrink: 0;
    }

    .mobile-user-details {
        flex: 1;
        min-width: 0;
    }

    .mobile-username {
        font-size: 0.95rem;
        font-weight: 700;
        line-height: 1.3;
    }

    .mobile-user-subtitle {
        font-size: 0.72rem;
        opacity: 0.85;
        line-height: 1.3;
        margin-top: 2px;
    }

    .mobile-auth-btn {
        width: 100%;
        padding: 7px;
        background: white;
        color: #1565C0;
        border: none;
        border-radius: 6px;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
    }

    .nav-section {
        margin-bottom: 8px !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .nav-section h3 {
        margin-bottom: 4px !important;
        margin-top: 8px !important;
        font-size: 0.7rem !important;
        color: #94a3b8;
        padding: 0 4px !important;
    }

    .forum-menu {
        padding: 0 !important;
    }

    .forum-menu-item {
        margin-bottom: 3px;
    }

    .forum-menu-item a {
        display: flex;
        align-items: center;
        padding: 7px 10px !important;
        font-size: 0.88rem !important;
        color: #334155;
        border-radius: 6px;
        line-height: 1.4;
    }

    .forum-menu-item.active a {
        background: #f0f7ff;
        color: #1565C0;
        font-weight: 600;
    }

    /* 显示移动端汉堡菜单按钮 */
    .mobile-menu-btn {
        display: block !important;
    }
}

/* ==================== 移动端发帖模态框优化 ==================== */
@media (max-width: 768px) {
    /* 模态框背景层 - 移除半透明背景，改为纯白色 */
    #publishModal.modal {
        padding: 0 !important;
        background: white !important;
        backdrop-filter: none !important;
    }

    /* 模态框全屏显示 */
    #publishModal .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        max-height: 100vh !important;
        height: 100vh !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        animation: none !important;
    }

    /* 头部优化 - 防止按钮换行 */
    #publishModal .modal-header {
        padding: 8px 12px !important;
        flex-wrap: nowrap !important;
    }

    #publishModal .modal-header h3 {
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        margin-right: 8px !important;
    }

    #publishModal .modal-header > div {
        flex-shrink: 0 !important;
        gap: 6px !important;
    }

    #publishModal .modal-header button {
        height: 28px !important;
        padding: 0 10px !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
    }

    #publishModal .modal-close {
        font-size: 20px !important;
        margin-left: 2px !important;
    }

    /* 表单区域优化 */
    #publishModal .modal-body {
        padding: 10px 12px !important;
    }

    /* 类型选择和分类选择 */
    #publishModal form > div:first-child {
        flex-direction: column !important;
        gap: 8px !important;
        margin-bottom: 8px !important;
    }

    #publishModal form > div:first-child > div:first-child {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    #publishModal form > div:first-child > div:nth-child(2) {
        display: none !important; /* 隐藏分隔线 */
    }

    #publishModal form select {
        width: 100% !important;
        padding: 6px !important;
        font-size: 0.85rem !important;
    }

    /* 标题和标签输入框 */
    #publishModal input[type="text"] {
        padding: 8px !important;
        font-size: 0.9rem !important;
    }

    /* 编辑器容器 - 自适应高度 */
    #publishModal #editor-container {
        min-height: 150px !important; /* 初始高度降低 */
        max-height: 400px !important;
    }

    /* 编辑器工具栏优化 */
    #publishModal .w-e-toolbar {
        padding: 4px !important;
    }

    #publishModal .w-e-toolbar .w-e-bar-item {
        padding: 4px 6px !important;
        font-size: 0.85rem !important;
    }

    /* 编辑器内容区域 */
    #publishModal .w-e-text-container {
        font-size: 0.9rem !important;
    }

    /* 附件上传区域 */
    #publishModal #uploadZone {
        padding: 0 12px !important;
        height: 36px !important;
        font-size: 0.85rem !important;
    }

    /* 标签建议 */
    #publishModal #tagSuggestions {
        margin-bottom: 8px !important;
    }

    #publishModal .tag-suggestion {
        font-size: 0.75rem !important;
        padding: 3px 8px !important;
    }
}

/* 小屏幕设备额外优化 (≤480px) */
@media (max-width: 480px) {
    #publishModal .modal-header h3 {
        font-size: 0.85rem !important;
    }

    #publishModal .modal-header button {
        height: 26px !important;
        padding: 0 8px !important;
        font-size: 0.7rem !important;
    }

    #publishModal .modal-close {
        font-size: 18px !important;
    }

    #publishModal input[type="text"] {
        font-size: 0.85rem !important;
    }
}
