/* ============================================================================
   首页（Home/Index.cshtml）移动端专项优化
   ============================================================================ */

/* 超小屏优化（< 640px）*/
@media (max-width: 639px) {
    /* Hero区域 */
    .aurora-hero {
        min-height: auto;
        padding: 60px 0;
    }

    .mega-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
        gap: 0.15rem;
    }

    .mega-number {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }

    .hero-grid {
        min-height: auto;
    }

    .hero-data {
        min-height: 0;
        height: auto;
    }

    .aurora-hero .hero-grid {
        text-align: left;
    }

    .aurora-hero .hero-content {
        gap: 1.5rem;
    }

    .aurora-hero .mega-title span {
        white-space: normal;
    }

    /* 数据卡片优化 */
    .data-card {
        padding: 0.75rem;
    }

    .data-card .mega-number {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    /* 按钮优化 */
    .modern-btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        text-align: center;
    }

    .flex.flex-wrap.gap-4 {
        flex-direction: column;
    }

    /* 产品网格 */
    .grid.md\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .grid.lg\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .grid.md\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .grid.sm\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* 卡片padding优化 */
    .p-6 {
        padding: 1.25rem !important;
    }

    .p-8 {
        padding: 1.5rem !important;
    }

    /* 间距优化 */
    .gap-4 {
        gap: 1rem !important;
    }

    .gap-6 {
        gap: 1.5rem !important;
    }

    .gap-16 {
        gap: 2.5rem !important;
    }

    .space-y-3 > * + * {
        margin-top: 0.75rem;
    }

    .space-y-4 > * + * {
        margin-top: 1rem;
    }

    .space-y-6 > * + * {
        margin-top: 1.5rem;
    }

    .space-y-8 > * + * {
        margin-top: 2rem;
    }

    /* 字体大小优化 */
    .text-4xl {
        font-size: clamp(1.75rem, 5vw, 2.25rem);
    }

    .text-5xl {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .text-3xl {
        font-size: clamp(1.375rem, 4.5vw, 1.875rem);
    }

    .text-2xl {
        font-size: clamp(1.125rem, 3vw, 1.5rem);
    }

    .text-xl {
        font-size: clamp(1rem, 2.5vw, 1.25rem);
    }

    .text-lg {
        font-size: clamp(0.875rem, 2vw, 1.125rem);
    }

    .text-sm {
        font-size: 0.8125rem;
    }

    /* Section padding */
    .py-16 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .py-14 {
        padding-top: 3.25rem !important;
        padding-bottom: 3.25rem !important;
    }

    .py-20 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    /* Container padding */
    .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* 隐藏桌面端元素 */
    .hidden.md\:inline-flex {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .backdrop-blur-sm,
    .backdrop-blur-xl {
        backdrop-filter: none !important;
    }
}

/* 小屏优化（640px - 767px）*/
@media (min-width: 640px) and (max-width: 767px) {
    .mega-title {
        font-size: clamp(2.5rem, 6vw, 4.5rem);
    }

    .aurora-hero .hero-data {
        height: auto;
        min-height: 0;
    }

    .grid.md\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 触摸优化（所有移动设备）*/
@media (hover: none) and (pointer: coarse) {
    /* 增大触摸目标 */
    .modern-btn,
    .data-card a {
        min-height: 48px;
        min-width: 48px;
    }

    /* 移除hover效果 */
    .data-card:hover,
    .list-item:hover,
    .modern-btn:hover {
        transform: none;
    }

    /* 使用active状态代替hover */
    .data-card:active,
    .list-item:active,
    .modern-btn:active {
        transform: translateY(-2px);
    }
}

/* 横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .aurora-hero {
        padding: 40px 0;
    }

    .mega-title {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }

    .hero-grid {
        min-height: auto;
    }

    .hero-data {
        min-height: 300px;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .data-card,
    .list-item {
        border-width: 0.5px;
    }

    .modern-btn {
        border-width: 1px;
    }
}

/* 低性能设备优化（减少动画）*/
@media (prefers-reduced-motion: reduce) {
    .aurora-bg,
    .animate-pulse,
    .animate-bounce {
        animation: none !important;
    }

    .data-card,
    .list-item {
        transition: none;
    }
}

/* 加载状态优化 */
.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ECharts容器移动端优化 */
#chart1, #chart2, #chart3 {
    min-height: 40px;
}

@media (max-width: 639px) {
    #chart1, #chart2, #chart3 {
        min-height: 30px;
    }
}

/* 列表项滚动条美化 */
@media (max-width: 767px) {
    .list-items {
        scrollbar-width: thin;
        scrollbar-color: #cbd5e1 #f1f5f9;
    }

    .list-items::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    .list-items::-webkit-scrollbar-track {
        background: #f1f5f9;
    }

    .list-items::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 2px;
    }

    .list-items::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
}

/* 通知栏移动端优化 */
@media (max-width: 767px) {
    .home-notice {
        padding: 12px 0;
    }

    .home-notice .ui-container {
        flex-direction: column;
        text-align: left;
        padding: 0 1rem;
    }

    .home-notice-title {
        font-size: 0.9rem;
        white-space: normal;
    }

    .home-notice-more {
        display: none; /* 移动端隐藏"更多"链接 */
    }
}

/* 图片占位符优化 */
@media (max-width: 639px) {
    .list-item-pic {
        height: 160px;
    }
}

/* 字体加载优化（FOIT防止）*/
.font-loading .mega-title,
.font-loading .text-4xl,
.font-loading .text-5xl {
    font-family: system-ui, -apple-system, sans-serif;
}
