/* ===================================
   多端适配优化样式
   解决iPad、移动端等设备的显示问题
   =================================== */

/* iPad 横屏优化 (1024px - 1366px) */
@media screen and (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    /* 成员卡片 - iPad横屏显示3列 */
    [data-anchor="Members"] .col-lg-3 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    /* 代码仓库卡片 - iPad横屏显示3列 */
    [data-anchor="Repository"] .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .modern-repo-card {
        min-height: 380px;
    }
    
    /* 专属权益 - iPad横屏显示4列 */
    [data-anchor="Vip"] .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* iPad 竖屏优化 (768px - 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    /* 成员卡片 - iPad竖屏显示2列 */
    [data-anchor="Members"] .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* 代码仓库卡片 - iPad竖屏显示2列 */
    [data-anchor="Repository"] .col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .modern-repo-card {
        min-height: 360px;
        padding: 22px;
    }
    
    /* 专属权益 - iPad竖屏显示3列 */
    [data-anchor="Vip"] .col-lg-3 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    /* 关于我们部分优化 */
    [data-anchor="About"] .row {
        align-items: center;
    }
    
    [data-anchor="About"] .col-lg-7,
    [data-anchor="About"] .col-lg-5 {
        padding: 0 20px;
    }
}

/* 大屏手机优化 (414px - 767px) */
@media screen and (min-width: 414px) and (max-width: 767px) {
    /* 成员卡片 - 大屏手机显示2列 */
    [data-anchor="Members"] .col-lg-3,
    [data-anchor="Members"] .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 8px;
    }
    
    .team-card-single {
        margin-bottom: 20px;
    }
    
    .team-card-single .content {
        padding: 15px 10px;
    }
    
    .team-card-single .content h4 {
        font-size: 1rem;
    }
    
    .team-card-single .content p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    /* 代码仓库卡片 - 大屏手机单列 */
    [data-anchor="Repository"] .col-lg-4,
    [data-anchor="Repository"] .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .modern-repo-card {
        min-height: 320px;
        margin-bottom: 20px;
    }
    
    /* 专属权益 - 大屏手机显示2列 */
    [data-anchor="Vip"] .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 8px;
    }
}

/* 标准手机优化 (375px - 413px) */
@media screen and (min-width: 375px) and (max-width: 413px) {
    /* 成员卡片 - 标准手机显示2列 */
    [data-anchor="Members"] .col-lg-3,
    [data-anchor="Members"] .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 6px;
    }
    
    .team-card-single .content {
        padding: 12px 8px;
    }
    
    .team-card-single .content h4 {
        font-size: 0.95rem;
    }
    
    .team-card-single .content p {
        font-size: 0.8rem;
    }
    
    /* 专属权益 - 标准手机显示2列 */
    [data-anchor="Vip"] .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 0 6px;
    }
}

/* 小屏手机优化 (320px - 374px) */
@media screen and (max-width: 374px) {
    /* 成员卡片 - 小屏手机单列 */
    [data-anchor="Members"] .col-lg-3,
    [data-anchor="Members"] .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .team-card-single {
        margin-bottom: 15px;
    }
    
    /* 专属权益 - 小屏手机单列 */
    [data-anchor="Vip"] .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大触摸目标 */
    .action-btn {
        min-height: 48px;
        padding: 14px 20px;
    }
    
    .repo-actions .action-btn {
        min-width: 120px;
    }
    
    /* 优化卡片间距 */
    .modern-repo-card,
    .team-card-single {
        margin-bottom: 20px;
    }
    
    /* 移除悬停效果，使用点击效果 */
    .modern-repo-card:active,
    .team-card-single:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .repo-icon,
    .team-card-single .thumb img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 横屏模式通用优化 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    /* 减少垂直间距 */
    .vlt-section {
        padding: 40px 0;
    }
    
    .modern-repo-card {
        min-height: auto;
        padding: 16px;
    }
    
    .team-card-single {
        margin-bottom: 15px;
    }
    
    /* 优化导航 */
    .vlt-navbar {
        padding: 10px 0;
    }
}

/* 可访问性优化 */
@media (prefers-reduced-motion: reduce) {
    .modern-repo-card,
    .team-card-single,
    .action-btn {
        transition: none;
    }
    
    .vlt-animated-block {
        animation: none !important;
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .modern-repo-card,
    .team-card-single {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.15) 0%,
            rgba(255, 255, 255, 0.08) 100%);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* 打印样式优化 */
@media print {
    .modern-repo-card,
    .team-card-single {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .action-btn {
        display: none;
    }
}

/* 超宽屏优化 (1920px+) */
@media screen and (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
    
    /* 成员卡片 - 超宽屏显示6列 */
    [data-anchor="Members"] .col-lg-3 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
    
    /* 代码仓库卡片 - 超宽屏显示4列 */
    [data-anchor="Repository"] .col-lg-4 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* 4K屏幕优化 (2560px+) */
@media screen and (min-width: 2560px) {
    .container {
        max-width: 1800px;
    }
    
    .modern-repo-card {
        min-height: 450px;
        padding: 32px;
    }
    
    .team-card-single {
        padding: 24px;
    }
    
    /* 字体大小适配 */
    .repo-name {
        font-size: 1.4rem;
    }
    
    .repo-desc {
        font-size: 1rem;
    }
    
    .team-card-single .content h4 {
        font-size: 1.3rem;
    }
    
    .team-card-single .content p {
        font-size: 1rem;
    }
}