/* 修复石化行业解决方案板块样式问题 */

/* 强制使用网格布局 */
.industry-solutions {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem !important;
    margin-top: 2rem !important;
    width: 100% !important;
}

/* 修复图标尺寸 */
.solution-icon {
    width: 56px !important;
    height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #EBF3FF !important;
    border-radius: 8px !important;
    margin-bottom: 1.25rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.solution-icon img {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
}

/* 修复卡片样式，确保它们是块状的 */
.solution-card {
    background-color: #FFFFFF !important;
    border-radius: 16px !important;
    padding: 1.5rem !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    border-top: 3px solid transparent !important;
    text-align: center !important;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
}

/* 修复按钮样式 */
.solution-link {
    color: #FFFFFF !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    margin-top: auto !important;
    background-color: #0055FF !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.solution-link:hover {
    background-color: #0044CC !important;
    color: #FFFFFF !important;
    transform: translateY(-2px) !important;
}

.solution-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(0, 85, 255, 0.15) !important;
    border-top-color: #0055FF !important;
}

/* 响应式样式修复 */
@media (max-width: 1024px) {
    .industry-solutions {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .industry-solutions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .solution-card {
        margin-bottom: 1rem !important;
        height: auto !important;
    }
    
    .solution-icon {
        width: 52px !important;
        height: 52px !important;
    }
    
    .solution-icon img {
        width: 26px !important;
        height: 26px !important;
        max-width: 26px !important;
        max-height: 26px !important;
    }
    
    .solution-link {
        width: 100% !important;
        text-align: center !important;
    }
    
    /* 修复侧边栏在移动端的显示 */
    .app-container .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: block;
    }
    
    .app-container.sidebar-visible .sidebar {
        transform: translateX(0);
    }
    
    /* 使用CSS变量计算高度，解决iOS设备上的问题 */
    .main-content {
        height: calc(100 * var(--vh)) !important;
        min-height: -webkit-fill-available !important;
    }
    
    .chat-messages {
        height: calc((100 * var(--vh)) - 120px) !important;
        min-height: 300px !important; /* 确保最小高度 */
    }
    
    /* 防止iOS橡皮筋效果导致的布局问题 */
    html, body {
        position: relative !important;
        height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* 确保滚动区域正常工作 */
    .chat-messages {
        -webkit-overflow-scrolling: touch !important;
        overflow-y: auto !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* 修复iOS上输入框问题 */
    .chat-input {
        position: relative !important;
        z-index: 2 !important;
    }
    
    /* 确保内容在键盘弹出时正确显示 */
    .app-container {
        height: 100% !important;
        overflow: auto !important;
        position: relative !important;
    }
    
    /* 确保聊天头部固定在顶部 */
    .chat-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
        background-color: #fff !important;
        border-bottom: 1px solid #E2E8F0 !important;
    }
    
    /* 优化输入框区域 */
    .chat-input-container {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        background-color: #fff !important;
        padding-bottom: env(safe-area-inset-bottom, 10px) !important;
    }
    
    /* 优化输入框样式 */
    .chat-input {
        flex: 1 !important;
        margin: 0 8px !important;
        padding: 8px 12px !important;
        max-height: 100px !important;
        border-radius: 18px !important;
        border: 1px solid #E2E8F0 !important;
        resize: none !important;
        font-size: 16px !important; /* 防止iOS缩放 */
        line-height: 1.4 !important;
        overflow-y: auto !important;
    }
    
    /* 优化发送按钮 */
    .chat-send-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        border-radius: 50% !important;
        background-color: var(--primary-color) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-left: 4px !important;
    }
    
    /* 优化工具按钮 */
    .input-tool-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* 确保键盘弹出时输入框可见 */
    .chat-input:focus {
        position: relative !important;
        z-index: 101 !important;
    }
    
    /* 优化移动端菜单按钮 */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        cursor: pointer;
    }
    
    .mobile-menu-btn .icon-menu {
        width: 24px;
        height: 24px;
        color: #1E293B;
    }
    
    /* 优化聊天标题在移动端的显示 */
    .chat-header {
        padding: 0.75rem;
    }
    
    .chat-title {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 优化消息气泡在移动端的宽度 */
    .message-container {
        max-width: 90%;
    }
    
    /* 隐藏页脚在移动端的显示 */
    .chat-footer {
        display: none;
    }
    
    /* 改善滚动体验 */
    .chat-messages {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        overscroll-behavior: contain;
    }
    
    /* 优化输入框体验 */
    .chat-input {
        font-size: 16px; /* 避免iOS自动缩放 */
        padding: 10px;
        margin: 0;
        border-radius: 18px;
    }
    
    /* 优化按钮触摸区域 */
    .chat-send-btn,
    .input-tool-btn,
    .mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* 优化消息气泡样式 */
    .message-content {
        max-width: 100%;
        word-break: break-word;
    }
    
    /* 添加iOS安全区域支持 */
    .app-container {
        padding-top: env(safe-area-inset-top, 0);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    
    /* 优化文件上传提示框 */
    .file-upload-content {
        width: 95%;
        max-width: 350px;
        padding: 1.5rem;
    }
    
    .upload-area {
        padding: 1.5rem 1rem;
    }
    
    /* 修复微信内置浏览器的高度计算 */
    @supports (-webkit-overflow-scrolling: touch) {
        .chat-messages {
            height: calc(100vh - 130px) !important;
            max-height: none !important;
        }
        
        /* 针对微信内置浏览器的特殊处理 */
        .wx-browser .chat-messages {
            height: calc(100% - 130px) !important;
            padding-bottom: 80px !important;
        }
    }
}

@media (max-width: 480px) {
    .solution-icon {
        width: 48px !important;
        height: 48px !important;
    }
    
    .solution-icon img {
        width: 24px !important;
        height: 24px !important;
        max-width: 24px !important;
        max-height: 24px !important;
    }
    
    .solution-icon img {
        max-width: 100% !important;
        width: 24px !important;
        height: 24px !important;
    }
    
    .solution-link {
        width: 100% !important;
        display: block !important;
    }
    
    .message-container {
        max-width: 95%;
    }
    
    .message-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
    }
    
    .message-actions .btn-text {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* 确保图标在所有浏览器中正确显示 */
.solution-icon img[src$=".svg"] {
    width: 28px !important;
    height: 28px !important;
}

/* 确保按钮在所有浏览器中都有背景色 */
a.solution-link {
    background-color: #0055FF !important;
    color: white !important;
    text-decoration: none !important;
}

/* 添加备用布局方案，以防网格布局失效 */
.industry-solutions-section .container {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

/* 添加CSS变量用于视口高度计算 */
:root {
    --vh: 1vh;
}

/* iOS Safari滚动问题彻底修复 */
@supports (-webkit-touch-callout: none) {
    html {
        height: 100%;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: manipulation;
    }

    body {
        height: 100%;
        overflow: auto;
        touch-action: manipulation;
        -webkit-text-size-adjust: 100%;
        overscroll-behavior: none;
        position: relative;
    }

    /* 关键修复：禁用橡皮筋效果 */
    main {
        height: auto;
        overflow: visible;
        position: relative;
        z-index: 1;
        overscroll-behavior: none;
    }

    /* 确保所有区块能够正常滚动 */
    section {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        position: relative;
        z-index: 1;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        overflow: visible !important;
    }
}

/* 微信浏览器特殊处理 - 完全重写以修复内容显示问题 */
.wx-browser {
    height: auto !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* 微信浏览器通用显示修复 */
.wx-browser section,
.wx-browser .section-title,
.wx-browser .section-header,
.wx-browser p,
.wx-browser div {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

/* 微信浏览器强制显示"关于数智灵犀"板块 */
.wx-browser #about {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    padding: 3rem 0 !important;
    margin: 1rem 0 !important;
    background-color: #F8FAFC !important;
    border-top: 1px solid #E2E8F0 !important;
    position: relative !important;
    z-index: 1 !important;
}

.wx-browser #about * {
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.wx-browser .about-content {
    display: block !important;
    width: 100% !important;
}

.wx-browser .about-text {
    display: block !important;
    width: 100% !important;
    margin-bottom: 2rem !important;
}

.wx-browser .about-text p {
    display: block !important;
    margin-bottom: 1rem !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #333 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

.wx-browser .about-stats {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
    width: 100% !important;
}

.wx-browser .stat-item {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-align: center !important;
    padding: 1rem !important;
    background-color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}

.wx-browser .stat-number {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 2rem !important;
    font-weight: bold !important;
    color: #0055FF !important;
    margin-bottom: 0.5rem !important;
}

.wx-browser .stat-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 0.9rem !important;
}

/* 微信浏览器强制显示"石化行业税务分析能力"板块 */
.wx-browser #features {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    padding: 3rem 0 !important;
    margin: 1rem 0 !important;
    background-color: white !important;
    border-top: 1px solid #E2E8F0 !important;
    position: relative !important;
    z-index: 1 !important;
}

.wx-browser #features * {
    visibility: visible !important;
    opacity: 1 !important;
}

.wx-browser .features-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 2rem !important;
    margin-top: 2rem !important;
}

.wx-browser .feature-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 1.5rem !important;
    background-color: white !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    transition: all 0.3s ease !important;
    opacity: 1 !important;
    transform: none !important;
}

.wx-browser .feature-icon {
    width: 64px !important;
    height: 64px !important;
    background-color: #EBF3FF !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 1.25rem !important;
}

.wx-browser .feature-icon img {
    width: 32px !important;
    height: 32px !important;
}

.wx-browser .feature-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    margin-bottom: 1rem !important;
    display: block !important;
}

.wx-browser .feature-description {
    color: #64748B !important;
    line-height: 1.6 !important;
    display: block !important;
}

/* 移动设备上的特殊处理 */
@media (max-width: 768px) {
    .wx-browser .features-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .wx-browser .feature-item {
        padding: 1.25rem !important;
    }
    
    .wx-browser .feature-icon {
        width: 56px !important;
        height: 56px !important;
    }
    
    .wx-browser .feature-icon img {
        width: 28px !important;
        height: 28px !important;
    }
}

/* 强制禁用所有动画 */
.wx-browser *,
.safari-browser * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
} 