/* =========================================
   FlamingoTechs - 精选案例 (Showcase) 原生样式
   1:1 像素级复刻 Elementor 原作视觉、瀑布流 (Masonry) 与动画
   ========================================= */

/* 1. 页面主体容器与宽度对齐 (完美与 Header 对齐) */
.ft-showcase-page {
    width: 100%;
    min-height: 100vh;
    background-color: var(--e-global-color-c43eaf3, #FAFAFC);
}

.ft-showcase-container {
    width: min(92%, var(--container-max-width, 1280px));
    max-width: var(--container-max-width, 1280px);
    margin: 0 auto;
    padding: 72px 0 100px 0;
    box-sizing: border-box;
}

/* 2. 页面标题区 (1:1 复刻原版 post-3112 标题字号与间距) */
.ft-showcase-header {
    margin-bottom: 0;
}

.ft-showcase-subtitle {
    display: block;
    font-family: "flamingofont", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--e-global-color-accent, #0D0D16);
    margin: 0 0 12px 0;
    line-height: 1.25;
}

.ft-showcase-title {
    display: block;
    font-family: "flamingofont", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: clamp(34px, 4.2vw, 60px);
    font-weight: 800;
    line-height: 1.1;
    color: var(--e-global-color-accent, #0D0D16);
    margin: 0 0 48px 0;
    letter-spacing: -0.5px;
}

/* 3. 案例卡片网格与瀑布流 (Masonry) 容器 */
.ft-showcase-grid {
    position: relative;
    width: 100%;
    margin-bottom: 80px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-column-gap: 16px;
    align-items: start;
}

@media (max-width: 1024px) {
    .ft-showcase-container {
        width: 100%;
        padding: 40px 20px 80px 20px;
    }
    .ft-showcase-subtitle {
        font-size: 30px;
        margin-bottom: 10px;
    }
    .ft-showcase-title {
        font-size: 50px;
        margin-bottom: 36px;
    }
    .ft-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-column-gap: 16px;
        margin-bottom: 60px;
    }
}

@media (max-width: 767px) {
    .ft-showcase-container {
        width: 100%;
        padding: 30px 20px 60px 20px;
    }
    .ft-showcase-subtitle {
        font-size: 18px;
        margin-bottom: 8px;
    }
    .ft-showcase-title {
        font-size: 24px;
        margin-bottom: 24px;
    }
    .ft-showcase-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-bottom: 40px;
    }
}

/* 4. 单个案例卡片样式 (1:1 完全复刻原版 1.25s 优雅滑入 fadeInUp 动效与质感) */
.ft-showcase-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background-color: #ECECEC;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 2px 1px 4px 0px rgba(133.92, 133.92, 133.92, 0.2);
    cursor: pointer;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    user-select: none;
    height: auto;

    /* 滚动滑入初始态：下沉 60px + 透明 */
    opacity: 0;
    transform: translate3d(0, 60px, 0);
    transition: opacity 1.25s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 1.25s cubic-bezier(0.25, 0.1, 0.25, 1),
                background-color 0.3s ease,
                box-shadow 0.3s ease;
    will-change: opacity, transform;
}

/* 滚动进入激活态：滑入就位 */
.ft-showcase-card.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* 桌面端 3 列明显阶梯延时 (原版从容的延迟波浪感) */
@media (min-width: 1025px) {
    .ft-showcase-card:nth-child(3n + 1) {
        transition-delay: 0.1s;
    }
    .ft-showcase-card:nth-child(3n + 2) {
        transition-delay: 0.3s;
    }
    .ft-showcase-card:nth-child(3n + 3) {
        transition-delay: 0.5s;
    }
}

/* 平板端 2 列阶梯延时 */
@media (min-width: 768px) and (max-width: 1024px) {
    .ft-showcase-card:nth-child(2n + 1) {
        transition-delay: 0.1s;
    }
    .ft-showcase-card:nth-child(2n + 2) {
        transition-delay: 0.3s;
    }
}

/* 滑入完成后解除长延迟与 will-change，切换为即时敏捷的悬浮动效 */
.ft-showcase-card.animation-done {
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1),
                background-color 0.25s ease,
                box-shadow 0.25s ease;
    will-change: auto;
}

.ft-showcase-card.is-visible:hover {
    transition-delay: 0s !important;
    background-color: #E0E0E0;
    transform: translate3d(0, -4px, 0);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.ft-showcase-card:focus-visible {
    outline: 2px solid #7B61FF;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .ft-showcase-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* 卡片顶部标签 */
.ft-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ft-card-tag {
    background-color: #fafafc;
    color: #616161;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-block;
    line-height: 1.4;
}

/* 卡片标题 (1:1 复刻原版 loop-3165：字重 400 Regular，大小 1.6em，颜色 #0D0D16) */
.ft-card-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 1.6em;
    font-weight: 400;
    color: var(--e-global-color-accent, #0D0D16);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

/* 卡片描述正文 (1:1 复刻原版 loop-3165：字重 400，大小 1em / 16px，行高 1.6，颜色 #7A7A7A) */
.ft-card-desc {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 1em;
    font-weight: 400;
    line-height: 1.6;
    color: #7A7A7A;
    padding: 6px 0 0 0;
    margin: 0;
}

/* 卡片图片容器与图片 (1:1 复刻原版：完整自适应高度，不锁定宽高比，不裁切) */
.ft-card-image-wrap {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    margin-top: 14px;
    position: relative;
}

.ft-card-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    object-fit: unset;
    transition: transform 0.4s ease;
}

.ft-showcase-card:hover .ft-card-img {
    transform: scale(1.02);
}

/* =========================================
   5. 案例长截图弹窗 (Modal)
   ========================================= */
.custom-showcase-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.custom-showcase-modal.is-active {
    opacity: 1;
}

/* 半透明背景模糊蒙层 */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

/* 弹窗内容主卡片 */
.modal-content-box {
    position: relative;
    background: #ffffff;
    width: 88%;
    max-width: 1100px;
    height: 90vh;
    border-radius: 18px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
    z-index: 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(18px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-showcase-modal.is-active .modal-content-box {
    transform: translateY(0) scale(1);
}

/* 弹窗内长图滚动区域 */
.modal-scroll-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 36px 40px 40px 40px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.modal-scroll-area::-webkit-scrollbar {
    width: 8px;
}

.modal-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.modal-scroll-area::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.modal-scroll-area::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* 关闭按钮 (右上角圆环) */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #f1f3f5;
    color: #475569;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    padding: 0;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.08);
}

.modal-close-btn:active {
    transform: scale(0.96);
}

/* 弹窗内文字排版 */
.modal-title {
    margin: 0 0 12px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    padding-right: 50px;
}

.modal-desc {
    margin: 0 0 28px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14.5px;
    color: #64748b;
    line-height: 1.65;
    max-width: 920px;
}

.modal-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    display: block;
}

@media (max-width: 768px) {
    .modal-content-box {
        width: 94%;
        height: 92vh;
        border-radius: 14px;
    }
    .modal-scroll-area {
        padding: 24px 18px 24px 18px;
    }
    .modal-title {
        font-size: 20px;
        padding-right: 40px;
    }
    .modal-desc {
        font-size: 13.5px;
        margin-bottom: 20px;
    }
    .modal-close-btn {
        top: 14px;
        right: 14px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}