/* =========================================================
   产品卡片悬停动画 — 完整修正版
   修复：功能导航区样式作用域
   ========================================================= */

/* --- 0. 自定义属性（--apc- 前缀隔离） --- */
:root {
    --apc-primary: #0056b3;
    --apc-primary-glow: rgba(0, 86, 179, 0.18);
    --apc-bg: #ffffff;
    --apc-border: rgba(0, 0, 0, 0.06);
    --apc-border-hover: rgba(0, 0, 0, 0.12);
    --apc-icon-bg: #f0f4f8;
    --apc-icon-color: #4a5568;
    --apc-icon-size: 72px;
    --apc-icon-font: 1.8rem;
    --apc-shadow-hover: 0 20px 40px rgba(0, 86, 179, 0.10);
    --apc-radius: 14px;
    --apc-ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
    --apc-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --apc-ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- 1. 产品网格容器 --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
}

/* --- 2. 卡片入场动画 --- */
@keyframes apc-cardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animated-product-card {
    opacity: 0;
    animation: apc-cardEnter 0.7s var(--apc-ease-smooth) forwards;
    border: 1px solid var(--apc-border);
    border-radius: var(--apc-radius);
    background-color: var(--apc-bg);
    transition: transform 0.45s var(--apc-ease-smooth),
                box-shadow 0.45s var(--apc-ease-smooth),
                border-color 0.35s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.animated-product-card:nth-child(1)  { animation-delay: 0.05s; }
.animated-product-card:nth-child(2)  { animation-delay: 0.12s; }
.animated-product-card:nth-child(3)  { animation-delay: 0.19s; }
.animated-product-card:nth-child(4)  { animation-delay: 0.26s; }
.animated-product-card:nth-child(5)  { animation-delay: 0.33s; }
.animated-product-card:nth-child(6)  { animation-delay: 0.40s; }
.animated-product-card:nth-child(7)  { animation-delay: 0.47s; }
.animated-product-card:nth-child(8)  { animation-delay: 0.54s; }
.animated-product-card:nth-child(9)  { animation-delay: 0.61s; }
.animated-product-card:nth-child(10) { animation-delay: 0.68s; }

.animated-product-card:hover,
.animated-product-card:focus-within {
    transform: translateY(-10px);
    box-shadow: var(--apc-shadow-hover);
    border-color: var(--apc-border-hover);
}

.animated-product-card:active {
    transform: translateY(-4px) scale(0.985);
    transition-duration: 0.1s;
}

/* --- 3. 卡片顶部渐变装饰条 --- */
.animated-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--apc-primary), #6dd5fa);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--apc-ease-smooth);
}

.animated-product-card:hover::before {
    transform: scaleX(1);
}

/* --- 4. 图标容器呼吸光晕 --- */
@keyframes apc-ringPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--apc-primary-glow);
    }
    50% {
        box-shadow: 0 0 0 8px transparent;
    }
}

/* --- 5. 图标容器核心样式 --- */
.animated-product-card .product-ico {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--apc-icon-size);
    height: var(--apc-icon-size);
    border-radius: 50%;
    background-color: var(--apc-icon-bg);
    margin-bottom: 1.25rem;
    animation: apc-ringPulse 3s ease-in-out infinite;
}

.animated-product-card .product-ico::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--apc-primary), #2196f3);
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s var(--apc-ease-elastic),
                opacity 0.3s ease;
    z-index: 1;
}

.animated-product-card .product-ico::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--apc-primary);
    opacity: 0;
    transform: scale(0.9);
    transition: transform 0.5s var(--apc-ease-bounce),
                opacity 0.4s ease;
    z-index: 0;
}

.animated-product-card .product-ico i {
    position: relative;
    z-index: 2;
    font-size: var(--apc-icon-font);
    color: var(--apc-icon-color);
    transition: color 0.4s ease,
                transform 0.5s var(--apc-ease-bounce);
}

.animated-product-card:hover .product-ico {
    animation: none;
}

.animated-product-card:hover .product-ico::before {
    transform: scale(1);
    opacity: 1;
}

.animated-product-card:hover .product-ico::after {
    transform: scale(1);
    opacity: 0.4;
}

.animated-product-card:hover .product-ico i {
    color: #ffffff;
    transform: scale(1.2) rotate(8deg);
}

/* --- 6. 卡片文本 --- */
.animated-product-card .apc-card-title {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
    transition: color 0.3s ease;
}

.animated-product-card:hover .apc-card-title {
    color: var(--apc-primary);
}

.animated-product-card .apc-card-text {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

/* --- 7. 按钮 --- */
.animated-product-card .product-btn {
    transition: all 0.35s ease;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.55rem 1.5rem;
}

.animated-product-card:hover .product-btn {
    background-color: var(--apc-primary);
    color: #ffffff;
    border-color: var(--apc-primary);
    box-shadow: 0 4px 14px rgba(0, 86, 179, 0.3);
}

/* =================================================================
   功能导航区（5个按钮）— 已移除 #page-home 限定
   .action-icon-btns 为首页专用 class，不会影响其他页面
   ================================================================= */

/* --- 入场动画 --- */
@keyframes apc-navEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.action-icon-btns a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    border-radius: var(--apc-radius);
    background: var(--apc-bg);
    border: 1px solid var(--apc-border);
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    opacity: 0;
    animation: apc-navEnter 0.6s var(--apc-ease-smooth) forwards;
    transition: transform 0.35s var(--apc-ease-smooth),
                box-shadow 0.35s ease,
                border-color 0.3s ease;
}

/* 功能导航级联入场延迟 */
.action-icon-btns .col-6:nth-child(1) a { animation-delay: 0.3s; }
.action-icon-btns .col-6:nth-child(2) a { animation-delay: 0.4s; }
.action-icon-btns .col-6:nth-child(3) a { animation-delay: 0.5s; }
.action-icon-btns .col-6:nth-child(4) a { animation-delay: 0.6s; }
.action-icon-btns .col-6:nth-child(5) a { animation-delay: 0.7s; }

/* 悬停浮起 + 阴影 */
.action-icon-btns a:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 28px rgba(0, 86, 179, 0.08);
    border-color: var(--apc-border-hover);
    text-decoration: none;
}

/* 触摸反馈 */
.action-icon-btns a:active {
    transform: translateY(-3px) scale(0.97);
    transition-duration: 0.1s;
}

/* --- 图标容器 --- */
.action-icon-btns a .ico-container {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: transform 0.35s var(--apc-ease-bounce);
}

/* 图标容器 ::before — 放射填充层 */
.action-icon-btns a .ico-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.45s var(--apc-ease-elastic),
                opacity 0.3s ease;
    z-index: 1;
}

/* 图标 */
.action-icon-btns a .ico-container i {
    position: relative;
    z-index: 2;
    font-size: 1.4rem;
    transition: color 0.35s ease,
                transform 0.4s var(--apc-ease-bounce);
}

/* 悬停：容器放大 + 放射填充 + 图标变色旋转 */
.action-icon-btns a:hover .ico-container {
    transform: scale(1.12);
}

.action-icon-btns a:hover .ico-container::before {
    transform: scale(1);
    opacity: 1;
}

.action-icon-btns a:hover .ico-container i {
    color: #ffffff;
    transform: scale(1.15) rotate(6deg);
}

/* --- 各色彩主题（背景 + 放射填充色） --- */

/* 青绿（公告） */
.card-accent-teal .ico-container {
    background: #e0f7fa;
    color: #00796b;
}
.card-accent-teal .ico-container::before {
    background: linear-gradient(135deg, #00796b, #26a69a);
}

/* 石榴红（网络状态） */
.card-accent-pomegranate .ico-container {
    background: #fce4ec;
    color: #c0392b;
}
.card-accent-pomegranate .ico-container::before {
    background: linear-gradient(135deg, #c0392b, #e57373);
}

/* 向日葵黄（知识库） */
.card-accent-sun-flower .ico-container {
    background: #fff8e1;
    color: #f39c12;
}
.card-accent-sun-flower .ico-container::before {
    background: linear-gradient(135deg, #f39c12, #ffb74d);
}

/* 石棉灰（下载） */
.card-accent-asbestos .ico-container {
    background: #eceff1;
    color: #607d8b;
}
.card-accent-asbestos .ico-container::before {
    background: linear-gradient(135deg, #607d8b, #90a4ae);
}

/* 绿（提交工单） */
.card-accent-green .ico-container {
    background: #e8f5e9;
    color: #27ae60;
}
.card-accent-green .ico-container::before {
    background: linear-gradient(135deg, #27ae60, #66bb6a);
}

/* --- 移动端适配 --- */
@media (max-width: 767.98px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.75rem;
    }

    .animated-product-card .card-body {
        padding: 1.5rem !important;
    }

    :root {
        --apc-icon-size: 60px;
        --apc-icon-font: 1.5rem;
    }

    .animated-product-card:hover {
        transform: none;
        box-shadow: none;
    }

    .animated-product-card:hover .product-ico::before {
        transform: scale(1);
        opacity: 1;
    }

    .animated-product-card:hover .product-ico::after {
        transform: scale(1);
        opacity: 0.4;
    }

    .animated-product-card:hover .product-ico i {
        color: #ffffff;
    }

    .animated-product-card:active {
        transform: scale(0.97);
    }

    .action-icon-btns a {
        padding: 1rem 0.5rem;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .action-icon-btns a .ico-container {
        width: 44px;
        height: 44px;
    }

    .action-icon-btns a .ico-container i {
        font-size: 1.1rem;
    }

    /* 移动端禁用悬浮位移，仅保留触摸缩放 */
    .action-icon-btns a:hover {
        transform: none;
        box-shadow: none;
    }

    .action-icon-btns a:active {
        transform: scale(0.96);
    }

    .action-icon-btns a:active .ico-container::before {
        transform: scale(1);
        opacity: 1;
    }

    .action-icon-btns a:active .ico-container i {
        color: #ffffff;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}