/* ==========================================
   移动端显示问题修复
   ========================================== */

/* 问题1: 通知页面顶部排版混乱 - 修复 */
@media (max-width: 767px) {
    /* 通知页面标题区域 */
    .notification-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .notification-title {
        font-size: 18px;
        font-weight: 600;
        margin: 0;
    }
    
    /* 通知筛选按钮组 */
    .notification-filters {
        display: flex;
        gap: 8px;
        align-items: center;
    }
    
    .notification-filters button {
        padding: 6px 12px;
        font-size: 14px;
        white-space: nowrap;
    }
}

/* 问题2: 输入框太小 - 修复 */
@media (max-width: 767px) {
    /* 所有输入框最小高度 */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    select {
        min-height: 44px !important;
        font-size: 16px !important; /* 防止iOS自动缩放 */
        padding: 10px 12px !important;
    }
    
    /* 文本域 */
    textarea {
        min-height: 120px !important;
        font-size: 16px !important;
        padding: 12px !important;
        line-height: 1.5;
    }
    
    /* 发帖页面的输入框 */
    .post-title-input {
        min-height: 44px !important;
        font-size: 16px !important;
    }
    
    .post-content-textarea {
        min-height: 200px !important;
        font-size: 16px !important;
    }
    
    /* 回复输入框 */
    .reply-textarea,
    .comment-textarea {
        min-height: 120px !important;
        font-size: 16px !important;
    }
}

/* 问题3: 底部导航栏没有贴底 - 修复 */
@media (max-width: 767px) {
    /* 页面布局 */
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        margin: 0;
        padding: 0;
    }
    
    /* 主内容区域 */
    main,
    .main-content {
        flex: 1;
        padding-bottom: 80px; /* 为底部导航栏留出空间 */
    }
    
    /* 底部导航栏固定在底部 */
    .bottom-nav,
    .mobile-nav,
    footer.mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: #fff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        z-index: 1000;
        padding: 8px 0;
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    .bottom-nav a,
    .mobile-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 4px 8px;
        min-height: 56px;
        text-decoration: none;
        color: #6b7280;
        font-size: 12px;
    }
    
    .bottom-nav a.active,
    .mobile-nav a.active {
        color: #3b82f6;
    }
    
    .bottom-nav svg,
    .mobile-nav svg {
        width: 24px;
        height: 24px;
        margin-bottom: 4px;
    }
}

/* 问题4: 版权栏没有贴底 - 修复 */
@media (max-width: 767px) {
    /* 版权信息栏 */
    .footer-copyright,
    .copyright-section {
        position: relative;
        background: #f9fafb;
        padding: 16px;
        text-align: center;
        font-size: 12px;
        color: #6b7280;
        margin-top: auto; /* 自动推到底部 */
        margin-bottom: 60px; /* 为底部导航栏留出空间 */
    }
    
    /* 如果版权栏在底部导航之外 */
    .footer-copyright.sticky,
    .copyright-section.sticky {
        position: fixed;
        bottom: 56px; /* 底部导航栏高度 */
        left: 0;
        right: 0;
        width: 100%;
        z-index: 999;
    }
}

/* 问题5: 弹窗图标居中但左边有间距 - 修复 */
@media (max-width: 767px) {
    /* 弹窗容器 */
    .modal,
    .popup,
    .dialog {
        padding: 0 !important;
    }
    
    /* 弹窗内容居中 */
    .modal-content,
    .popup-content,
    .dialog-content {
        margin: 0 auto;
        padding: 20px;
        text-align: center;
    }
    
    /* 图标完全居中 */
    .modal-icon,
    .popup-icon,
    .dialog-icon {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0 auto 16px;
        padding: 0;
    }
    
    .modal-icon img,
    .popup-icon img,
    .dialog-icon img {
        display: block;
        margin: 0 auto;
    }
}

/* 问题6: 回复/引用按钮太大 - 修复 */
@media (max-width: 767px) {
    /* 回复操作按钮组 */
    .reply-actions,
    .comment-actions,
    .post-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 12px;
    }
    
    /* 回复、引用等按钮 */
    .reply-btn,
    .quote-btn,
    .like-btn,
    .action-btn {
        padding: 6px 12px !important;
        font-size: 13px !important;
        min-height: 32px !important;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    
    /* 按钮图标 */
    .reply-btn svg,
    .quote-btn svg,
    .like-btn svg,
    .action-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* 表情按钮 */
    .emoji-btn {
        padding: 4px 8px !important;
        font-size: 18px !important;
        min-height: 32px !important;
    }
}

/* 问题7: 正文显得太小 - 修复 */
@media (max-width: 767px) {
    /* 帖子正文 */
    .post-content,
    .reply-content,
    .comment-content {
        font-size: 16px !important;
        line-height: 1.6;
        padding: 12px 0;
        color: #1f2937;
    }
    
    /* 帖子标题 */
    .post-title {
        font-size: 20px !important;
        font-weight: 600;
        line-height: 1.4;
        margin-bottom: 12px;
    }
    
    /* 用户信息区域 */
    .user-info {
        font-size: 14px;
        color: #6b7280;
        margin-bottom: 8px;
    }
    
    /* 回复卡片 */
    .reply-card,
    .comment-card {
        padding: 16px;
        margin-bottom: 12px;
        background: #fff;
        border-radius: 8px;
    }
}

/* 额外优化: 触摸区域优化 */
@media (max-width: 767px) {
    /* 所有可点击元素最小触摸区域 */
    a,
    button,
    .clickable {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* 链接内边距 */
    a:not(.bottom-nav a):not(.mobile-nav a) {
        padding: 8px;
    }
}

/* 额外优化: 页面滚动优化 */
@media (max-width: 767px) {
    /* 平滑滚动 */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 防止横向滚动 */
    body {
        overflow-x: hidden;
    }
    
    /* 内容区域 */
    .container,
    .content-wrapper {
        max-width: 100%;
        padding: 0 16px;
    }
}

/* 额外优化: 表单提交按钮 */
@media (max-width: 767px) {
    /* 发布按钮 */
    .submit-btn,
    .publish-btn,
    .send-btn {
        width: 100%;
        min-height: 48px !important;
        font-size: 16px !important;
        font-weight: 600;
        border-radius: 8px;
        margin-top: 16px;
    }
    
    /* 取消按钮 */
    .cancel-btn {
        width: 100%;
        min-height: 48px !important;
        font-size: 16px !important;
        border-radius: 8px;
        margin-top: 8px;
    }
}

/* 额外优化: 编辑器工具栏 */
@media (max-width: 767px) {
    /* 编辑器工具栏 */
    .editor-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
        background: #f9fafb;
        border-radius: 8px;
        margin-bottom: 12px;
    }
    
    .editor-toolbar button {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
        border-radius: 6px;
    }
    
    .editor-toolbar svg {
        width: 20px;
        height: 20px;
    }
}

/* 额外优化: 加载状态 */
@media (max-width: 767px) {
    /* 加载指示器 */
    .loading,
    .spinner {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 40px 0;
    }
}

/* 额外优化: 空状态 */
@media (max-width: 767px) {
    /* 空状态 */
    .empty-state {
        text-align: center;
        padding: 60px 20px;
    }
    
    .empty-state-icon {
        font-size: 48px;
        margin-bottom: 16px;
        opacity: 0.5;
    }
    
    .empty-state-text {
        font-size: 16px;
        color: #6b7280;
    }
}
