/**
 * 百家小组件样式
 * Author: 百家
 */

/* ========== 示例小组件样式 ========== */
.baijia-example-widget {
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.baijia-example-widget:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.baijia-example-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.baijia-example-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.baijia-example-title a:hover {
    color: #0073aa;
}

.baijia-example-description {
    margin: 0;
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* ========== 图片悬停效果小组件样式 ========== */
.baijia-image-hover-widget {
    width: 100%;
}

.baijia-image-hover-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* 第一个图片占据整行 */
.baijia-image-hover-gallery.first-full-width .baijia-picture-wrap:first-child {
    grid-column: 1 / -1;
}

.baijia-picture-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.baijia-imgBox {
    display: block;
    width: 100%;
    position: relative;
    text-decoration: none;
}

.baijia-imgBox img {
    width: 100%;
    height: auto;
    display: block;
}

/* 悬停遮罩层样式 */
.baijia-picture-description {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    transform: scale(0);
    transition: transform 0.4s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    pointer-events: none; /* 允许点击穿透到下方的链接 */
}

.baijia-picture-wrap:hover .baijia-picture-description {
    transform: scale(1);
}

.baijia-picture-description-inner {
    border: 1px solid #fff;
    padding: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.baijia-picture-description h3 {
    color: #ffffff;
    font-size: 24px;
    margin: 0;
    line-height: 1.4;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    /* 示例小组件 */
    .baijia-example-widget {
        padding: 15px;
    }
    
    .baijia-example-title {
        font-size: 20px;
    }
    
    .baijia-example-description {
        font-size: 14px;
    }

    /* 图片悬停小组件 */
    .baijia-image-hover-gallery {
        grid-template-columns: 1fr;
    }

    .baijia-image-hover-gallery.first-full-width .baijia-picture-wrap:first-child {
        grid-column: 1;
    }

    .baijia-picture-description h3 {
        font-size: 20px;
    }

    .baijia-picture-description-inner {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    /* 示例小组件 */
    .baijia-example-widget {
        padding: 12px;
    }
    
    .baijia-example-title {
        font-size: 18px;
    }

    /* 图片悬停小组件 */
    .baijia-picture-description h3 {
        font-size: 18px;
    }

    .baijia-picture-description {
        padding: 15px;
    }

    .baijia-picture-description-inner {
        padding: 10px;
    }
}

/* ========== 服务展开详情小组件样式 ========== */
.bai_tc_service-expand-widget {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.bai_tc_container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 0;
    height: 400px;
    overflow: hidden;
    box-sizing: border-box;
}

.bai_tc_service-item {
    position: relative;
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
}

.bai_tc_service-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 80%;
    background-color: #e0e0e0;
}

.bai_tc_service-item:last-child::after {
    display: none;
}

.bai_tc_service-item:hover,
.bai_tc_service-item.clicked {
    flex: 3;
}

.bai_tc_service-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.bai_tc_icon-wrapper {
    width: 100px;
    height: 100px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.bai_tc_service-item:hover .bai_tc_icon-wrapper,
.bai_tc_service-item.clicked .bai_tc_icon-wrapper {
    transform: scale(1.1);
}

.bai_tc_icon {
    width: 50px;
    height: 50px;
}

.bai_tc_icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--icon-color, #c41e3a);
    fill: none;
    stroke-width: 2;
}

.bai_tc_icon i {
    font-size: 50px;
    color: var(--icon-color, #c41e3a);
}

.bai_tc_service-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    text-align: center;
    letter-spacing: 2px;
    margin-bottom: 10px;
    white-space: nowrap;
}

.bai_tc_service-description {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease, max-height 0.5s ease;
    color: #666;
    line-height: 1.6;
    text-align: center;
    padding: 0 20px;
    font-size: 14px;
}

.bai_tc_service-item:hover .bai_tc_service-description,
.bai_tc_service-item.clicked .bai_tc_service-description {
    opacity: 1;
    max-height: 200px;
    margin-top: 15px;
}

.bai_tc_read-more {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease 0.2s, max-height 0.5s ease 0.2s;
    margin-top: 0;
}

.bai_tc_service-item:hover .bai_tc_read-more,
.bai_tc_service-item.clicked .bai_tc_read-more {
    opacity: 1;
    max-height: 50px;
    margin-top: 20px;
}

.bai_tc_read-more a {
    display: inline-block;
    padding: 10px 25px;
    background: #c41e3a;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.bai_tc_read-more a:hover {
    background: #a01829;
}

/* ========== 响应式设计 - 服务展开小组件 ========== */
@media (max-width: 768px) {
    .bai_tc_container {
        display: grid;
        height: auto;
        gap: 0;
    }

    /* 2列布局 */
    [data-mobile-cols="2"] .bai_tc_container {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 1列布局 */
    [data-mobile-cols="1"] .bai_tc_container {
        grid-template-columns: 1fr;
    }

    /* 3列布局 */
    [data-mobile-cols="3"] .bai_tc_container {
        grid-template-columns: repeat(3, 1fr);
    }

    .bai_tc_service-item {
        flex: none;
        height: 150px;
        transition: none;
    }

    .bai_tc_service-item:hover {
        flex: none;
    }

    .bai_tc_service-item::after {
        display: none;
    }

    .bai_tc_icon-wrapper {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }

    .bai_tc_icon {
        width: 30px;
        height: 30px;
    }

    .bai_tc_icon svg {
        width: 100%;
        height: 100%;
    }

    .bai_tc_icon i {
        font-size: 30px;
    }

    .bai_tc_service-title {
        font-size: 14px;
        letter-spacing: 1px;
        white-space: normal;
        word-break: break-word;
    }

    .bai_tc_service-description {
        display: none !important;
        opacity: 0 !important;
        max-height: 0 !important;
    }

    .bai_tc_read-more {
        display: none !important;
        opacity: 0 !important;
        max-height: 0 !important;
    }
}

/* ========== 分类卡片展示小组件样式 ========== */
.bai-wet-category-card-widget {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.bai-wet-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0;
    background: #fff;
    box-sizing: border-box;
}

.bai-wet-card {
    position: relative;
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
    height: 400px;
    overflow: hidden;
    background: #000;
    box-sizing: border-box;
}

.bai-wet-card a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}

.bai-wet-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 底部默认半透明条 + 标题 */
.bai-wet-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--title-height, 80px);
    background: var(--overlay-color, rgba(0, 0, 0, 0.55));
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s ease;
    text-align: center;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 悬停：黑色背景撑满，标题居中 */
.bai-wet-card:hover .bai-wet-title {
    height: 100%;
    background: var(--overlay-hover-color, rgba(0, 0, 0, 0.75));
}

/* 摘要样式 */
.bai-wet-excerpt {
    font-size: 14px;
    line-height: 1.6;
    margin-top: 10px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease 0.1s, max-height 0.3s ease 0.1s;
}

.bai-wet-card:hover .bai-wet-excerpt {
    opacity: 1;
    max-height: 200px;
}

.bai-wet-title-text {
    transition: font-size 0.3s ease;
}

.bai-wet-card:hover .bai-wet-title-text {
    font-size: 20px;
}

/* 响应式列数控制 */
@media (min-width: 1024px) {
    [data-columns="1"] .bai-wet-card {
        flex: 1 1 100%;
    }
    [data-columns="2"] .bai-wet-card {
        flex: 1 1 calc(50% - 10px);
    }
    [data-columns="3"] .bai-wet-card {
        flex: 1 1 calc(33.333% - 14px);
    }
    [data-columns="4"] .bai-wet-card {
        flex: 1 1 calc(25% - 15px);
    }
}

@media (max-width: 1023px) and (min-width: 768px) {
    .bai-wet-card {
        flex: 1 1 calc(50% - 10px);
    }
}

@media (max-width: 767px) {
    .bai-wet-card {
        flex: 1 1 100%;
        height: 300px;
    }

    .bai-wet-title {
        font-size: 18px;
        height: 60px;
    }

    .bai-wet-card:hover .bai-wet-title {
        height: 100%;
    }
}

