/* ============================================================================
   产品详情页系列移动端专项优化（适用于所有Product detail页面）
   ============================================================================ */

/* 超小屏优化（< 640px）*/
@media (max-width: 639px) {
    /* Hero区域 */
    .pd-hero {
        padding: 70px 0 40px;
    }

    .pd-hero__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .pd-hero h1 {
        font-size: clamp(1.5rem, 5vw, 2rem);
        line-height: 1.2;
    }

    .pd-tagline {
        font-size: 1rem;
    }

    .pd-desc {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .pd-badges {
        gap: 8px;
    }

    .pd-badge {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .pd-badge svg {
        width: 16px;
        height: 16px;
    }

    /* KPI区域 */
    .pd-kpis {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pd-kpi {
        padding: 10px;
    }

    .pd-kpi__v {
        font-size: 1rem;
    }

    .pd-kpi__k {
        font-size: 0.85rem;
    }

    /* Hero媒体 */
    .pd-hero-media {
        padding: 10px;
        border-radius: 16px;
    }

    /* Sticky导航 */
    .pd-sticky-nav {
        position: sticky;
        top: 70px; /* Header高度补偿 */
        z-index: 40;
    }

    .pd-sticky-nav__inner {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        scrollbar-width: none;
    }

    .pd-sticky-nav__inner::-webkit-scrollbar {
        display: none;
    }

    .pd-sticky-nav a {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    /* Section布局 */
    .pd-section {
        padding: 40px 0;
    }

    .pd-section--alt {
        padding: 40px 0;
    }

    .pd-container {
        padding: 0 1rem;
    }

    .pd-section-title h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .pd-section-title p {
        font-size: 0.95rem;
    }

    /* Grid布局 */
    .pd-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .pd-col-6 {
        grid-column: span 1;
    }

    /* 卡片 */
    .pd-card {
        padding: 1.25rem;
    }

    .pd-card__icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .pd-card__icon svg {
        width: 24px;
        height: 24px;
    }

    .pd-card h3 {
        font-size: 1.15rem;
        margin-bottom: 0.5rem;
    }

    .pd-card p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* 表格 */
    .pd-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .table {
        font-size: 0.9rem;
        min-width: 600px; /* 确保表格在移动端可横向滚动 */
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }

    .spec-label {
        font-weight: 600;
    }

    .spec-value {
        word-break: break-all;
    }

    /* 面包屑 */
    .breadcrumb {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .breadcrumb-item {
        padding: 0.2rem 0.4rem;
    }

    /* 按钮 */
    .pd-btn {
        width: 100%;
        padding: 12px 24px;
        font-size: 1rem;
    }

    /* FAQ */
    .pd-faq-item {
        margin-bottom: 0.75rem;
    }

    .pd-faq-q {
        padding: 1rem;
        font-size: 1rem;
    }

    .pd-faq-a {
        padding: 1rem;
        font-size: 0.95rem;
    }

    /* 场景卡片 */
    .scenario-card {
        margin-bottom: 1rem;
    }

    .scenario-card img {
        height: 200px;
    }

    /* 交付与服务 */
    .delivery-steps {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .delivery-step {
        padding: 1.25rem;
    }

    .delivery-step__icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .delivery-step__icon svg {
        width: 24px;
        height: 24px;
    }

    .delivery-step h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .delivery-step p {
        font-size: 0.9rem;
    }
}

/* 小屏优化（640px - 767px）*/
@media (min-width: 640px) and (max-width: 767px) {
    .pd-hero__grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .pd-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }

    .pd-kpis {
        grid-template-columns: repeat(3, 1fr);
    }

    .pd-container {
        padding: 0 1.5rem;
    }
}

/* 平板优化（768px - 1023px）*/
@media (min-width: 768px) and (max-width: 1023px) {
    .pd-hero {
        padding: 90px 0 50px;
    }

    .pd-hero__grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .pd-hero-media {
        order: -1;
    }

    .pd-kpis {
        grid-template-columns: repeat(3, 1fr);
    }

    .pd-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pd-sticky-nav__inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pd-container {
        padding: 0 2rem;
    }
}

/* 横屏优化 */
@media (max-width: 1024px) and (orientation: landscape) {
    .pd-hero {
        padding: 50px 0 30px;
    }

    .pd-section {
        padding: 30px 0;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .pd-card,
    .pd-btn,
    .pd-faq-q,
    .scenario-card,
    .pd-badge {
        min-height: 48px;
        min-width: 48px;
    }

    .pd-card:active,
    .pd-btn:active,
    .pd-faq-q:active {
        transform: scale(0.98);
    }

    /* 移除hover效果 */
    .pd-card:hover {
        transform: none;
        box-shadow: none;
    }

    .pd-badge:hover {
        background: rgba(255,255,255,.14);
    }
}

/* 动画优化（移动端禁用复杂动画）*/
@media (max-width: 767px) {
    .pd-card {
        transition: none;
    }

    .pd-btn {
        transition: none;
    }

    .pd-hero::after {
        display: none;
    }

    /* 简化加载动画 */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .pd-card,
    .pd-section-title,
    .scenario-card {
        animation: fadeInUp 0.3s ease-out;
    }
}

/* 表格横向滚动指示器 */
@media (max-width: 767px) {
    .pd-table-wrap::after {
        content: '→';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1));
        padding: 0 10px;
        font-size: 1.2rem;
        pointer-events: none;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .pd-card,
    .pd-btn,
    .pd-badge,
    .pd-faq-q,
    .scenario-card {
        transition: none;
        animation: none;
    }

    .pd-hero::after {
        display: none;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .pd-page {
        --pd-text: #000000;
        --pd-bg: #FFFFFF;
    }

    .pd-card {
        border: 2px solid #000000;
    }

    .pd-table th,
    .pd-table td {
        border-width: 2px;
    }

    .pd-btn {
        border-width: 2px;
    }
}

/* 打印样式 */
@media print {
    .pd-hero,
    .pd-sticky-nav,
    .breadcrumb-section {
        page-break-after: always;
    }

    .pd-card,
    .scenario-card {
        break-inside: avoid;
    }

    .pd-table-wrap {
        page-break-inside: avoid;
    }
}

/* 优化图片加载 */
@media (max-width: 767px) {
    .pd-hero-media,
    .scenario-card img {
        background: #f0f0f0;
        min-height: 200px;
    }

    img[loading="lazy"] {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }

    img[loading="lazy"].loaded {
        background: none;
        animation: none;
    }
}

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

/* Hero背景优化 */
@media (max-width: 767px) {
    .pd-hero {
        background-size: cover;
        background-position: center 70%;
    }
}

/* FAQ手风琴动画优化 */
@media (max-width: 767px) {
    .pd-faq-a {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }

    .pd-faq-item.active .pd-faq-a {
        max-height: 500px;
    }
}

/* 按钮间距优化 */
@media (max-width: 480px) {
    .pd-btn-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pd-btn {
        width: 100%;
    }
}

/* 字体加载优化 */
.font-loading .pd-hero h1,
.font-loading .pd-section-title h2 {
    font-family: system-ui, -apple-system, sans-serif;
}

/* 场景卡片图片高度优化 */
@media (max-width: 639px) {
    .scenario-card {
        margin-bottom: 1.5rem;
    }

    .scenario-card img {
        min-height: 180px;
        max-height: 250px;
        object-fit: cover;
    }
}

/* 交付步骤图标大小优化 */
@media (max-width: 480px) {
    .delivery-step {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .delivery-step__icon {
        flex-shrink: 0;
        width: 45px;
        height: 45px;
    }

    .delivery-step-content {
        flex: 1;
    }

    .delivery-step h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .delivery-step p {
        font-size: 0.85rem;
    }
}

/* 导航滚动隐藏（向上滚动显示，向下滚动隐藏）*/
@media (max-width: 767px) {
    .pd-sticky-nav {
        transition: transform 0.3s ease;
    }

    .pd-sticky-nav.nav-hidden {
        transform: translateY(-100%);
    }

    .pd-sticky-nav.nav-visible {
        transform: translateY(0);
    }
}

/* 触摸反馈 */
@media (hover: none) and (pointer: coarse) {
    .pd-card:active::after,
    .pd-btn:active::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(255,255,255,0.1);
        animation: touch-ripple 0.6s ease-out;
    }
}

@keyframes touch-ripple {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
    }
}
