/* Service page - Enhanced hover transition version */
.top {
    position: relative;
    width: 100%;
    height: 18.46vw;
    overflow: hidden;
}

.top span {
    position: absolute;
    bottom: 0;
    left: 18%;
    transform: translate(-15%, 0);
    color: #fff;
    font-size: 3vw;
    font-weight: 500;
    text-shadow: #757a76 2px 2px 4px;
}

/* Layout wrapper */
.commcont {
    padding-left: 0;
    padding-right: 0;
    background-color: #fff;
}

.commcont .bdycont {
    padding: 4vw 16vw 100px;
}

/* Back button */
.copyBox_btn {
    text-align: center;
    margin-top: 2vw;
}

.copyBox_btn button {
    padding: 6px 26px;
    background-color: transparent;
    border: 1px solid #4d4d4d;
    border-radius: 1.875rem;
    font-size: 0.67vw;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.copyBox_btn button:hover {
    border-color: #00A2E9;
    color: #00A2E9;
}

/* Cards container: 四張平排 */
.bdycont {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: stretch;
    width: 100%;
    padding-bottom: 100px;
}

/* Single card: 平均 4 張 */
.entranceBox {
    flex: 0 0 25%;
    max-width: 25%;
    position: relative;
    overflow: hidden;
    border-radius: 1.2vw;
    background-color: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    will-change: transform, box-shadow;
}

.entranceBox:hover {
    transform: translateY(-0.5vw);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* Card image */
.entrance_img {
    position: relative;
    width: 100%;
    height: 32vw;
    overflow: hidden;
}

.entrance_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity;
}

/* Center icon on image */
.entrance_img_i {
    margin: 0 auto;
    width: 60%;
    position: absolute;
    right: 50%;
    bottom: 10%;
    transform: translate(50%, 10%) scale(1);
    opacity: 1;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.entrance_img_i img {
    width: 100%;
    height: auto;
}

/* Overlay mask - 使用 opacity + transform 取代 display */
.entrance_mask {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top, rgba(0, 162, 233, 0.7), rgba(0, 0, 0, 0.85));
    backdrop-filter: blur(4px);
    
    /* 初始隱藏狀態 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scale(0.95);
    
    /* 平滑過渡 */
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform, visibility;
}

.entranceBox:hover .entrance_mask {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.entrance_mask a {
    display: block;
    height: 100%;
    width: 100%;
}

/* Overlay text */
.entrance_mask_text {
    color: #fff;
    line-height: 2;
    padding: 4vw 2vw;
    font-size: 0.87vw;
    font-weight: 100;
    text-align: justify;
    opacity: 0.9;
    letter-spacing: 0.02em;
}

.entrance_mask_text div {
    font-size: 1.3vw;
    font-weight: 500;
}

.entrance_mask_text i {
    display: block;
    width: 25%;
    height: 4px;
    background-color: #fff;
    margin: 0.8vw 0 1.2vw;
}

.entrance_mask_text span {
    display: block;
}

/* Hover 狀態：隱藏圖示，淡化背景圖 */
.entranceBox:hover .entrance_img img {
    opacity: 0.2;
}

.entranceBox:hover .entrance_img_i {
    opacity: 0;
    transform: translate(50%, 10%) scale(0.8);
}

/* Arrow icon at bottom */
.entrance_mask .ent_mask_toitem {
    margin: 0 auto;
    width: 3.5vw;
    position: absolute;
    right: 50%;
    bottom: 9%;
    transform: translate(50%, 9%);
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s;
}

.entranceBox:hover .entrance_mask .ent_mask_toitem {
    opacity: 1;
}

.entrance_mask .ent_mask_toitem img {
    width: 100%;
    height: auto;
}

/* 確保 hover 在行動裝置可點擊 */
@media (hover: none) and (pointer: coarse) {
    .entrance_mask {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) scale(1) !important;
    }
    
    .entrance_img img {
        opacity: 0.2 !important;
    }
    
    .entrance_img_i {
        opacity: 0 !important;
    }
}
