/* 
 * 移动端响应式优化样式
 * 适用于所有前台页面
 */

/* ==================== 通用移动端优化 ==================== */

/* 小屏幕设备 (手机竖屏) */
@media (max-width: 576px) {
    /* 容器内边距优化 */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 标题字体大小优化 */
    h1, .h1 {
        font-size: 1.75rem !important;
    }
    
    h2, .h2 {
        font-size: 1.5rem !important;
    }
    
    h3, .h3 {
        font-size: 1.25rem !important;
    }
    
    h4, .h4 {
        font-size: 1.1rem !important;
    }
    
    /* 按钮优化 */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* 卡片优化 */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* 导航栏优化 */
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0;
    }
    
    /* 表单优化 */
    .form-control,
    .form-select {
        font-size: 1rem;
    }
    
    /* 模态框优化 */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    /* 表格优化 */
    .table-responsive {
        font-size: 0.85rem;
    }
    
    /* 间距优化 */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .my-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }
}

/* 中等屏幕设备 (手机横屏/平板竖屏) */
@media (max-width: 768px) {
    /* Hero区域优化 */
    .hero-section,
    .page-header {
        padding: 2rem 0 !important;
        min-height: auto !important;
    }
    
    .hero-section h1,
    .page-header h1 {
        font-size: 2rem !important;
    }
    
    .hero-section .lead,
    .page-header .lead {
        font-size: 1rem !important;
    }
    
    /* 统计卡片优化 */
    .stats-section,
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
    
    /* 网格布局优化 */
    .row > [class*='col-'] {
        margin-bottom: 1rem;
    }
    
    /* 图片优化 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* 轮播图优化 */
    .carousel-item img {
        height: 250px;
        object-fit: cover;
    }
    
    .carousel-caption {
        padding: 0.5rem;
    }
    
    .carousel-caption h5 {
        font-size: 1rem;
    }
    
    .carousel-caption p {
        font-size: 0.85rem;
        display: none;
    }
    
    /* 面包屑导航优化 */
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }
    
    /* 分页优化 */
    .pagination {
        font-size: 0.9rem;
    }
    
    .pagination .page-link {
        padding: 0.375rem 0.75rem;
    }
    
    /* 徽章优化 */
    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* 列表组优化 */
    .list-group-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* ==================== 首页特定优化 ==================== */
@media (max-width: 768px) {
    /* 首页轮播图 */
    #heroCarousel .carousel-item {
        height: 300px;
    }
    
    #heroCarousel .carousel-caption {
        bottom: 1rem;
    }
    
    /* 服务卡片 */
    .service-card {
        margin-bottom: 1rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* 新闻列表 */
    .news-item {
        padding: 1rem;
    }
    
    .news-item h5 {
        font-size: 1rem;
    }
    
    /* 底部信息 */
    footer {
        padding: 2rem 0 1rem;
    }
    
    footer .col-md-3,
    footer .col-md-4 {
        margin-bottom: 1.5rem;
    }
}

/* ==================== 会员申请页面优化 ==================== */
@media (max-width: 768px) {
    /* 申请类型选择 */
    .type-options {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .type-option {
        padding: 1.5rem;
    }
    
    /* 表单步骤 */
    .form-steps {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .step-item {
        width: 100%;
    }
    
    /* 表单字段 */
    .form-row {
        flex-direction: column;
    }
    
    .form-row .col-md-6 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* 文件上传 */
    .upload-area {
        padding: 2rem 1rem;
    }
    
    /* 提交按钮 */
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ==================== 会员查询页面优化 ==================== */
@media (max-width: 768px) {
    /* 搜索表单 */
    .search-form {
        padding: 1.5rem 1rem;
    }
    
    .search-form .row {
        flex-direction: column;
    }
    
    .search-form .col-md-4,
    .search-form .col-md-3 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* 搜索结果 */
    .search-results .card {
        margin-bottom: 1rem;
    }
    
    .member-card {
        padding: 1rem;
    }
    
    .member-avatar {
        width: 60px;
        height: 60px;
    }
    
    /* 筛选标签 */
    .filter-tabs .nav-pills {
        flex-direction: column;
    }
    
    .filter-tabs .nav-link {
        margin-bottom: 0.5rem;
    }
}

/* ==================== 会员风采页面优化 ==================== */
@media (max-width: 768px) {
    /* 会员卡片 */
    .member-showcase-card {
        margin-bottom: 1.5rem;
    }
    
    .member-photo {
        height: 200px;
    }
    
    .member-info {
        padding: 1rem;
    }
    
    .member-name {
        font-size: 1.1rem;
    }
    
    /* 统计信息 */
    .stats-section {
        padding: 1.5rem 1rem;
        margin: -2rem 0 2rem;
    }
    
    .stat-item {
        padding: 1rem 0.5rem;
    }
    
    .stat-item::after {
        display: none;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* ==================== 会员系统页面优化 ==================== */
@media (max-width: 768px) {
    /* 会员轮播 */
    .member-carousel-wrapper .carousel-image-wrapper {
        height: 250px;
    }
    
    /* 功能卡片 */
    .feature-card {
        margin-bottom: 1rem;
        padding: 1.5rem 1rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* 流程步骤 */
    .process-steps {
        flex-direction: column;
    }
    
    .process-step {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .process-step::after {
        display: none;
    }
}

/* ==================== 文章详情页面优化 ==================== */
@media (max-width: 768px) {
    /* 文章内容 */
    .article-content {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .article-meta {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    .article-body {
        font-size: 1rem;
        line-height: 1.8;
    }
    
    .article-body img {
        max-width: 100%;
        height: auto;
    }
    
    /* 侧边栏 */
    .sidebar {
        margin-top: 2rem;
    }
}

/* ==================== 导航菜单优化 ==================== */
@media (max-width: 992px) {
    /* 折叠菜单 */
    .navbar-collapse {
        background: white;
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 0.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .navbar-dark .navbar-collapse {
        background: rgba(0,0,0,0.95);
    }
    
    .navbar-nav {
        gap: 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .navbar-dark .navbar-nav .nav-link {
        border-bottom-color: rgba(255,255,255,0.1);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    /* 下拉菜单 */
    .dropdown-menu {
        border: none;
        box-shadow: none;
        padding-left: 1rem;
    }
}

/* ==================== 触摸优化 ==================== */
@media (hover: none) and (pointer: coarse) {
    /* 增大可点击区域 */
    .btn,
    .nav-link,
    .dropdown-item,
    .page-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* 移除hover效果 */
    .card:hover,
    .btn:hover {
        transform: none;
    }
    
    /* 优化表单输入 */
    input,
    textarea,
    select {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* ==================== 横屏优化 ==================== */
@media (max-width: 768px) and (orientation: landscape) {
    /* 减少垂直间距 */
    .hero-section,
    .page-header {
        padding: 1rem 0 !important;
    }
    
    .py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    /* 轮播图高度 */
    .carousel-item,
    .carousel-item img {
        height: 200px;
    }
}

/* ==================== 超小屏幕优化 ==================== */
@media (max-width: 375px) {
    /* 进一步缩小字体 */
    body {
        font-size: 0.9rem;
    }
    
    h1, .h1 {
        font-size: 1.5rem !important;
    }
    
    h2, .h2 {
        font-size: 1.3rem !important;
    }
    
    /* 按钮 */
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    /* 卡片 */
    .card-body {
        padding: 0.75rem;
    }
    
    /* 容器 */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ==================== 打印优化 ==================== */
@media print {
    /* 隐藏不必要的元素 */
    .navbar,
    .breadcrumb,
    .btn,
    footer,
    .sidebar {
        display: none !important;
    }
    
    /* 优化内容显示 */
    .container {
        max-width: 100%;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    /* 确保链接可见 */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* ==================== 可访问性优化 ==================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==================== 深色模式支持 ==================== */
@media (prefers-color-scheme: dark) {
    /* 如果需要支持深色模式，可以在这里添加样式 */
}
