/* ========================================
   非凡工造 - 产品中心页面专用样式
   ======================================== */

/* ========== 产品 Hero 区域 ========== */
.products-hero {
    position: relative;
}

/* ========== 搜索栏 ========== */
.product-search-wrap {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s;
}

.product-search-input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    font-size: 15px;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(51, 65, 85, 0.1);
    border-radius: var(--radius-full);
    outline: none;
    transition: var(--transition-base);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.product-search-input::placeholder {
    color: #94a3b8;
}

.product-search-input:focus {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1), 0 0 0 3px rgba(99, 102, 241, 0.06);
    background: #fff;
}

.product-search-input:focus + .search-icon,
.product-search-wrap:focus-within .search-icon {
    color: #635bff;
}

/* ========== 分类筛选粘性栏 ========== */
.sticky-top-bar {
    position: sticky;
    top: 80px;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 14px 0;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(51, 65, 85, 0.04);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.filter-chip:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #4c46d6;
}

.filter-chip.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    color: #4c46d6;
    border-color: rgba(99, 102, 241, 0.2);
    font-weight: 600;
}

.filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    transition: var(--transition-base);
}

.filter-chip.active .filter-dot {
    background: #635bff;
    box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
}

/* ========== 排序 & 统计 ========== */
.result-count {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.result-count span {
    font-weight: 700;
    color: var(--text-primary);
}

.sort-select-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-label {
    font-size: 13px;
    color: var(--text-tertiary);
}

.sort-select {
    padding: 6px 30px 6px 12px;
    font-size: 13px;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: #fff;
    border: 1px solid rgba(51, 65, 85, 0.1);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: var(--transition-base);
}

.sort-select:focus {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.06);
}

/* ========== 产品网格 ========== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* ========== 产品卡片 ========== */
.product-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition-base);
    cursor: default;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    border-color: rgba(99, 102, 241, 0.15);
}

.product-card.hidden-card {
    display: none;
}

/* 卡片图片占位区 */
.card-image-area {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    position: relative;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .placeholder-img {
    transform: scale(1.03);
}

/* 占位图背景色 - 各分类 */
.hardware-bg {
    background: linear-gradient(135deg, #635bff, #8b5cf6, #a78bfa);
}
.software-bg {
    background: linear-gradient(135deg, #22c55e, #10b981, #34d399);
}
.iot-bg {
    background: linear-gradient(135deg, #f59e0b, #f97316, #fbbf24);
}
.service-bg {
    background: linear-gradient(135deg, #ec4899, #db2777, #f472b6);
}

/* 智能温控模块实物图 */
.product-render-bg {
    isolation: isolate;
    background: linear-gradient(145deg, #f59e0b 0%, #f97316 54%, #fbbf24 100%);
}
.product-render-bg::before {
    content: '';
    position: absolute;
    z-index: 0;
    width: 72%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 68%);
    filter: blur(2px);
}
.product-render-bg::after {
    content: '';
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    opacity: 0.13;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 88%);
}
.product-card-render {
    position: relative;
    z-index: 1;
    width: 90%;
    height: 91%;
    max-width: none;
    object-fit: contain;
    transform: translateY(3%);
    filter: drop-shadow(0 18px 24px rgba(76, 34, 8, 0.34));
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}
.product-card:hover .product-render-bg { transform: scale(1.01); }
.product-card:hover .product-card-render {
    transform: translateY(1%) scale(1.035);
    filter: drop-shadow(0 22px 30px rgba(76, 34, 8, 0.4));
}

/* 电路巡检机器人真实样机图 */
.robot-card-bg {
    isolation: isolate;
    background: linear-gradient(145deg, #d8aa67, #9c6f1d 58%, #5b4024);
}
.robot-card-bg::after {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(42, 33, 23, 0.02) 48%, rgba(42, 33, 23, 0.52)),
        radial-gradient(circle at 50% 40%, transparent 38%, rgba(42, 33, 23, 0.22));
}
.robot-card-render {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease;
}
.product-card:hover .robot-card-render {
    transform: scale(1.045);
    filter: saturate(1.04) contrast(1.02);
}
.robot-detail-badge {
    color: #5f3700;
    background: rgba(255, 247, 214, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 8px 22px rgba(42, 33, 23, 0.2);
}

/* 即将上线角标 */
.coming-soon-badge {
    position: absolute;
    z-index: 3;
    top: 14px;
    right: 14px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

/* 预购角标：暖金色呼吸光，与品牌紫形成醒目但克制的对比 */
.preorder-badge {
    overflow: hidden;
    color: #5f3700;
    background: linear-gradient(135deg, #fff7d6 0%, #fbbf24 48%, #f59e0b 100%);
    background-size: 180% 100%;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        0 0 0 1px rgba(245, 158, 11, 0.2),
        0 8px 22px rgba(120, 53, 15, 0.28);
    animation: preorder-glow 2.8s ease-in-out infinite;
}

.preorder-badge::before {
    content: '';
    position: absolute;
    top: -60%;
    bottom: -60%;
    left: -45%;
    width: 34%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
    transform: skewX(-20deg);
    animation: preorder-sheen 3.6s ease-in-out infinite;
}

@keyframes preorder-glow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), 0 7px 18px rgba(120, 53, 15, 0.24);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.16), 0 10px 26px rgba(120, 53, 15, 0.34);
    }
}

@keyframes preorder-sheen {
    0%, 28% { left: -45%; opacity: 0; }
    38% { opacity: 1; }
    62% { left: 115%; opacity: 0; }
    100% { left: 115%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .preorder-badge,
    .preorder-badge::before { animation: none; }
}

/* 卡片内容区 */
.card-body {
    padding: 22px 24px 24px;
}

.card-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.08);
    color: #635bff;
}

.tag-hardware { background: rgba(99, 102, 241, 0.08); color: #635bff; }
.tag-software { background: rgba(34, 197, 94, 0.08); color: #16a34a; }
.tag-iot      { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.tag-service  { background: rgba(236, 72, 153, 0.08); color: #db2777; }
.tag-hot      { background: rgba(239, 68, 68, 0.08); color: #ef4444; }
.tag-new      { background: rgba(59, 130, 246, 0.08); color: #2563eb; }

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.card-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.status-ready { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.status-dev   { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.status-soon  { background: rgba(245, 158, 11, 0.1); color: #d97706; }

.card-btn {
    font-size: 13px;
    font-weight: 600;
    color: #635bff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}

.card-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #4c46d6;
}

a.card-btn {
    display: inline-block;
    text-decoration: none;
}

/* ========== 整卡可点击 ========== */
.product-card.card-clickable {
    position: relative;
    cursor: pointer;
}
.card-link-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    text-indent: -9999px;
}
.card-clickable a.card-btn {
    position: relative;
    z-index: 4;
}
/* 鼠标移入整卡时，按钮也呈现 hover 态 */
.card-clickable:hover a.card-btn {
    background: rgba(99, 102, 241, 0.08);
    color: #4c46d6;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

/* ========== CTA 区域 ========== */
.cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #faf5ff 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06), transparent 60%);
    pointer-events: none;
}

.cta-inner {
    position: relative;
    z-index: 1;
    padding: 48px 32px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(10px);
}

/* ========== 页脚链接 ========== */
.footer-link {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 0;
    transition: var(--transition-base);
}

.footer-link:hover {
    color: #635bff;
    padding-left: 4px;
}

/* ========== 响应式设计 ========== */

@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .sticky-top-bar {
        top: 72px;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-body {
        padding: 18px 20px 20px;
    }

    .filter-bar {
        gap: 8px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .filter-bar::-webkit-scrollbar {
        display: none;
    }

    .filter-chip {
        padding: 7px 14px;
        font-size: 13px;
    }

    .cta-section {
        padding: 56px 0;
    }

    .cta-inner {
        padding: 32px 20px;
    }
}

@media (max-width: 480px) {
    .product-search-input {
        padding: 14px 16px 14px 46px;
        font-size: 14px;
    }

    .search-icon {
        left: 14px;
        width: 18px;
        height: 18px;
    }

    .card-title {
        font-size: 16px;
    }

    .sort-select-wrap {
        display: none;
    }
}

/* ========== 卡片动画增强 ========== */
.product-card {
    opacity: 0;
    transform: translateY(30px);
}

.product-card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 交错延迟 */
.product-card:nth-child(1) { transition-delay: 0s; }
.product-card:nth-child(2) { transition-delay: 0.08s; }
.product-card:nth-child(3) { transition-delay: 0.16s; }
.product-card:nth-child(4) { transition-delay: 0.24s; }
.product-card:nth-child(5) { transition-delay: 0.32s; }
.product-card:nth-child(6) { transition-delay: 0.4s; }
