/* 
 * 首页响应式样式 - 全局 H1-H4, P 移动端样式
 */

/* 移动端样式 */
@media (max-width: 768px) {
    /* == 轮播图 == */
    .banner {
        height: 250px !important; /* 大幅减小高度 */
        margin-top: 60px !important; /* 假设移动端导航栏高度为60px */
    }
    .banner .swiper-slide img {
        object-position: center center !important; /* 尝试居中图片主体 */
    }
    /* 隐藏PC端的导航按钮 */
    .banner .swiper-button-prev,
    .banner .swiper-button-next {
        display: none !important;
    }
    /* 调整分页器位置 */
    .banner .swiper-pagination {
        bottom: 10px !important;
    }

    /* == 通用调整 == */
    /* section, .section-common 的 padding 已移至 responsive/comm/base.css */
    /* .container 的 padding 已移至 responsive/comm/base.css */

    /* 强制块级显示 - 移除无效的 vertical-align */
    section div[style*="display:table"],
    section div[style*="display:table-cell"],
    .about-section .container > div[style*="display:table"] > div
    {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 0 20px 0 !important;
        box-sizing: border-box !important;
    }
    section div[style*="display:table"] > div:last-child {
         margin-bottom: 0 !important;
     }
     
    /* 重置可能存在的 float */
    [style*="float"] { /* 比较通用，慎用 */
        float: none !important;
        width: 100% !important; 
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* 确保 lawyer-text-cell 和 video-wrapper 是块级 */
    .lawyer-text-cell,
    .video-wrapper,
    .about-video-content
     {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px !important; 
    }
    .about-section .container > div > .lawyer-text-cell { 
         margin-bottom: 20px !important;
    }
    .about-section .container > div > div:has(> .video-wrapper) { 
        margin-bottom: 30px !important; 
    }
     .lawyer-placeholder-cell { 
        display: none !important;
    }
    .about-section .about-video-content {
        order: initial !important; 
    }
    .about-section .video-wrapper iframe,
    .about-section .video-wrapper video {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16/9 !important; 
        min-height: 200px;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* !! 强制重置所有相关 .lawyer-text-cell 的 padding !! */
    .about-section .lawyer-text-cell,
    .lawyer-section .lawyer-text-cell,
    .honor-section .lawyer-text-cell,
    .service-unit-section .lawyer-text-cell,
    .contact-section .lawyer-text-cell {
        padding: 0 !important; 
        margin-bottom: 20px !important; /* 保持下方间距 */
        display: block !important; /* 确保块级 */
        width: 100% !important;
        box-sizing: border-box !important;
    }
    /* 特别处理合伙律师第二个 cell，也重置 padding */
    .lawyer-section .lawyer-scroll + .lawyer-text-cell {
         padding: 0 !important;
         margin-top: 20px !important; /* 重置PC端过大的margin-top */
         margin-bottom: 20px !important;
    }

    /* --- 全局文本样式 (移动端) --- */
    /* 字体大小、对齐、边距等已移至 responsive/comm/base.css */
    /* 保留部分特定 P 元素的样式 */

     /* 明确指定需要这些样式的正文 P (示例，需要根据实际结构调整) */
    .lawyer-text-cell p:not(h1 + h2):not(h2 + p):not(h3 + p), 
    .lawyer-text-cell h3 + p,
    .lawyer-scroll + .lawyer-text-cell p,
    .about-text-content p /* 如果关于页有这个类 */
    {
        /* font-size, line-height, margin-bottom 由全局 P 控制 */
        text-indent: 2em !important;  
        text-align: justify !important; 
        padding-left: 10px !important; 
        padding-right: 10px !important; 
        margin-right: 0 !important; 
        box-sizing: border-box !important; 
        width: 100% !important; 
        display: block !important; 
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    /* 最后一个 P 的间距 - 保留 */
    .lawyer-text-cell p:last-of-type,
    .lawyer-scroll + .lawyer-text-cell p:last-of-type,
    .about-text-content p:last-of-type
    {
         margin-bottom: 0 !important; 
    }

    

    /* 移动端显示元素 */
    .mobile-only {
        display: block !important;
    }
    .pc-only-layout {
        display: none !important;
    }
    
    /* == 专业领域 == */
    /* 清理旧的移动端专业领域样式 */
    .professional-field-section .pc-only-layout {
        display: none !important; 
    }
    .professional-field-section .mobile-only-layout {
        display: block !important;
    }
    /* 以下为重建的样式 */
    .professional-field-section .mobile-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2px !important; /* 卡片间细小的间隙 */
    }
    .professional-field-section .mobile-col {
        position: relative !important; /* 作为内部绝对定位元素的参照 */
    }
    .professional-field-section .pro-card {
        position: relative !important; /* 自身也是参照物 */
        display: block !important; /* 确保是块级 */
        height: auto !important; /* 高度由图片决定 */
        overflow: hidden !important; /* 隐藏溢出 */
        cursor: pointer;
        -webkit-tap-highlight-color: transparent !important; /* 移除移动端点击高亮 */
        outline: none !important;
    }
    .professional-field-section .pro-card img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }

    /* 悬停/激活效果 - 图片缩放模糊淡入 */
    .professional-field-section .pro-card .hover-content {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        opacity: 0; /* 初始透明 */
        transition: opacity 0.3s ease; /* 容器快速淡入 */
        pointer-events: none !important;
        z-index: 2 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }
    
    /* 修改：内部图片样式 - 添加缩放、模糊、淡入动画 */
    .professional-field-section .pro-card .hover-content img {
        position: relative !important; 
        z-index: 2 !important;     
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        /* 初始状态：透明、缩小、模糊 */
        opacity: 0; 
        transform: scale(0.9);
        filter: blur(5px);
        /* 添加过渡效果和延迟 */
        transition: opacity 0.7s ease 0.1s, transform 0.7s ease 0.1s, filter 0.7s ease 0.1s;
    }

    /* 激活状态 */
    .professional-field-section .pro-card.active .hover-content {
        opacity: 1; /* 激活容器 */
        pointer-events: auto !important;
    }
        
    /* 修改：激活图片动画 */
    .professional-field-section .pro-card.active .hover-content img {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }

    /* == 律师团队 == */

    /* == 震序荣誉 == */
    .honor-section .lawyer-text-cell { /* 荣誉部分文字容器 */
        margin-bottom: 20px !important;
    }
    .honor-section .lawyer-button-cell { /* 隐藏荣誉部分的占位按钮格 */
        display: none !important;
    }
     .honor-scroll {
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 15px !important; 
        margin-left: -10px !important; /* 调整为容器内边距 */
        margin-right: -10px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        display: block !important; 
        scrollbar-width: none !important; 
    }
    .honor-scroll::-webkit-scrollbar {
        display: none !important; 
    }
    .honor-slider {
        display: inline-flex !important;
        /* Removed transition/transform overrides to potentially allow JS animation */
        /* transition: none !important; */
        /* transform: none !important; */
    }
    .honor-card { /* 荣誉卡片 */
        width: 180px !important; 
        margin-right: 10px !important;
        display: inline-block !important;
        vertical-align: top !important;
        white-space: normal !important; 
        flex-shrink: 0 !important;
        cursor: pointer;
    }
    .honor-card:last-child {
        margin-right: 0 !important;
    }
    .honor-card > div { /* 卡片内部容器 */
        width: 100% !important;
        height: 125px !important; /* 卡片高度 */
        overflow: hidden !important;
        position: relative !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
        border-radius: 5px !important; 
    }
    .honor-card img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* == 服务单位 == */
    .service-unit-section .lawyer-text-cell {
        margin-bottom: 20px !important;
    }
    .service-unit-section .lawyer-button-cell { /* 隐藏服务单位部分的占位按钮格 */
        display: none !important;
    }
    .service-unit-logos {
        text-align: center !important;
        margin-top: 20px !important;
        margin-bottom: 0px !important; /* 调整与底部的距离 */
        padding-bottom: 0 !important; 
    }
    .service-unit-logos .desktop-logo {
        display: none !important;
    }
    .service-unit-logos .mobile-logo {
        display: inline-block !important;
        max-width: 90% !important; /* 调整logo最大宽度 */
        height: auto;
        margin: 0 auto !important; /* 居中 */
    }

    /* == 联系我们 == */
    .contact-section .lawyer-text-cell {
        margin-bottom: 20px !important;
    }
    .contact-section .lawyer-placeholder-cell {
        display: none !important;
    }
    
    /* 移动端标题样式 */
    @media (max-width: 768px) {
        /* 只在移动端显示br.mobile-break */
        br.mobile-break {
            display: block !important;
        }
    }

    /* 重置联系我们按钮的上边距 */
    #contact-us-section div[style*="margin-top:145px"],
    .contact-button-wrapper { 
        margin-top: 30px !important;
    }

    /* 荣誉模态框适配 */
    .honor-modal-container {
        width: 90% !important;
        max-width: 500px !important;
    }
    .honor-modal-image {
        max-height: 80vh !important;
    }
    #honor-modal-close {
        top: 5px !important;
        right: 5px !important;
        width: 30px !important;
        height: 30px !important;
        font-size: 24px !important;
        line-height: 30px !important;
        background-color: rgba(0,0,0,0.5);
        border-radius: 50%;
    }

    /* 背景图片移动端适配 */
    [style*="background-image"].section-common { /* 确保选择器足够具体 */
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center top !important;
        min-height: auto !important; /* 移除最小高度限制 */
    }

    /* --- 移动端标题间距和对齐调整 --- */
    .about-section h2,
    .lawyer-section h2,
    .honor-section h2,
    .service-unit-section h2,
    .contact-section h2 {
        margin-bottom: 8px !important; /* 进一步减小间距 */
        text-align: center !important; /* 居中 */
    }

    .about-section h3,
    .lawyer-section h3,
    .honor-section h3,
    .service-unit-section h3,
    .contact-section h3 {
        margin-bottom: 4px !important; /* 进一步减小间距 */
        text-align: center !important; /* 居中 */
    }

    .about-section h4,
    .lawyer-section h4,
    .honor-section h4,
    .service-unit-section h4,
    .contact-section h4 {
        margin-bottom: 4px !important; /* 进一步减小间距 */
        text-align: center !important; /* 居中 */
        line-height: 0.3 !important; /* 设置行距 */
        letter-spacing: 0.5px !important; /* 减小字间距 */
    }

    /* 为最后一个 H4 增加底部外边距 */
    .about-section h4:last-of-type,
    .lawyer-section h4:last-of-type,
    .honor-section h4:last-of-type,
    .service-unit-section h4:last-of-type,
    .contact-section h4:last-of-type {
        margin-bottom: 45px !important; /* 调整与下方内容的间距 */
    }

    /* --- Mobile Button Adjustments --- */

    /* Center buttons within their containers - Reverted to text-align */
    .about-more,
    .lawyer-button-cell,
    .lawyer-section .lawyer-text-cell,
    .contact-button-wrapper {
        text-align: center !important; /* Center inline-level children */
        /* Removed: display: block !important; (or rely on default/other rules) */
        /* Removed: display: flex, justify-content: center */
        /* Keep specific resets for contact wrapper below */
    }

    /* Make the direct button parent inline-block for centering - ONLY for contact cell */
    .contact-button-cell { /* Targets the cell containing the contact button */
        display: inline-block !important; /* Allow parent's text-align:center to work */
        width: auto !important;    /* Override block width if any */
        vertical-align: middle !important; /* Optional vertical align */
        float: none !important; /* Reset potential float */
        /* Reset other potential table-cell related properties if necessary */
    }

    /* Apply position/float resets and margin only to contact wrapper where needed */
    .contact-button-wrapper {
        position: static !important;
        float: none !important;
        right: auto !important;
        bottom: auto !important;
        margin: 30px 0 0 0 !important; /* Keep specific top margin */
    }

    /* Hide the specific non-button-cell div (likely spacer) on mobile */
    .contact-button-wrapper > div:not(.contact-button-cell) {
        display: none !important;
    }

    /* Style the actual button links - Reduce Size & Prevent Wrap */
    .about-more a,
    .lawyer-button-cell a,
    .lawyer-section .lawyer-text-cell a,
    .contact-button-wrapper a {
        padding: 8px 18px !important; /* Reduce padding */
        font-size: 16px !important; /* Reduce font size */
        display: inline-flex !important; /* Use inline-flex for internal alignment and centering by parent */
        align-items: center !important; /* Vertically align logo and text */
        justify-content: center !important; /* Horizontally center logo and text within button */
        text-align: center !important; /* Keep text centered if it somehow wraps (fallback) */
        white-space: nowrap !important; /* Prevent internal wrapping */
    }

    /* Specific adjustment for Contact Us button - REMOVED as merged above */
    /* .contact-button-wrapper a { ... } REMOVED */
}

