/* ========== 移动端优化（宽度 <= 768px） ========== */
@media (max-width: 768px) {
    body {
        font-size: 13px;
        padding-bottom: 130px;   /* 60px底部导航 + 70px固定评论框 */
    }
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* 导航栏 */
    .navbar {
        height: 40px;
        padding: 0 12px;
    }
    .nav-container {
        height: 40px !important;
        justify-content: space-between;
        align-items: center;
    }
    .logo-area {
        gap: 4px;
        align-items: center;
    }
    .logo-text {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
    .logo-icon {
        font-size: 1.2rem;
    }
    #back-btn {
        color: var(--text-secondary);
        font-size: 1rem;
        align-self: center;
        line-height: 1;
    }
    .user-area {
        gap: 6px;
        align-items: center;
    }
    .avatar {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }
    #navbar-username {
        display: none;
    }
    .search-bar,
    .nav-links {
        display: none;
    }

    /* Hero 区域（移动端放大） */
    .hero {
        margin: 0 -12px;
        border-radius: 0;
        height: auto;
        min-height: 180px;
        padding: 24px 20px;
        background: var(--bg-hero);
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }
    .hero-content {
        text-align: left;
        width: 100%;
    }
    .hero h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    .hero p {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    .hero-btn {
        padding: 8px 20px;
        font-size: 0.85rem;
        margin-top: 0;
    }

    /* 主网格 */
    .main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* 帖子卡片 */
    .post-card {
        padding: 12px;
        margin-bottom: 10px;
    }
    .post-title { font-size: 0.9rem; }
    .post-meta { font-size: 0.65rem; gap: 8px; flex-wrap: wrap; }
    .sidebar-card { padding: 12px; }
    #new-post-btn { padding: 4px 12px; font-size: 0.75rem; }

    /* 帖子详情卡片贴边 */
    #post-container .post-card {
        border-radius: 0;
        margin-left: -12px;
        margin-right: -12px;
        padding-left: 12px;
        padding-right: 12px;
    }

    /* 帖子内容内边距（移动端） */
    .post-content-inner {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* 评论区域 */
    .comment-card { padding: 8px 10px; }
    .comment-avatar { width: 28px; height: 28px; }
    .comment-author { font-size: 0.75rem; }
    .comment-content { font-size: 0.8rem; margin: 4px 0; }
    .comment-actions { margin-top: 4px; gap: 8px; }
    .reply-btn,.delete-comment-btn { padding: 2px 8px; font-size: 0.7rem; line-height: 1.2; }
    .reply-form { margin-left: 20px; margin-top: 6px; }
    .reply-form textarea { padding: 6px; font-size: 0.75rem; }
    .reply-form button { padding: 4px 10px; font-size: 0.7rem; }
    .comment-box textarea { padding: 8px; font-size: 0.8rem; }
    .comment-box button { padding: 6px 14px; font-size: 0.8rem; }

    .footer { padding: 20px 0; font-size: 0.7rem; }
    .avatar-small { width: 24px; height: 24px; }

    /* 自定义下拉移动端适配 */
    .custom-select-trigger {
      padding: 6px 28px 6px 10px;
      font-size: 0.8rem;
    }
    .custom-select-trigger::after {
      right: 8px;
      border-left-width: 4px;
      border-right-width: 4px;
      border-top-width: 5px;
    }
    .custom-select-option {
      padding: 6px 10px;
      font-size: 0.8rem;
    }
}

/* 极小屏幕（宽度 <= 480px）微调 */
@media (max-width: 480px) {
    .hero h2 { font-size: 1.3rem; }
    .post-title { font-size: 0.85rem; }
    .comment-header { flex-wrap: wrap; }
    .comment-actions { gap: 6px; }
    .logo-text { font-size: 0.9rem; }
    #navbar-username { display: none; }
    #back-btn { font-size: 0.9rem; }
}

/* ========== 底部导航栏（移动端） ========== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: var(--bottom-nav-bg);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--bottom-nav-border);
    z-index: 1000;
}
.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: var(--bottom-nav-color);
    font-size: 0.7rem;
    padding: 4px 0;
    transition: color 0.2s;
}
.mobile-bottom-nav a i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}
.mobile-bottom-nav a.active {
    color: var(--bottom-nav-active);
}

/* 桌面端隐藏底部导航栏 */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* 移动端显示底部导航栏 */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
}