@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0052D9;
    --bg-gray: #f8fafc;
}

body {
    font-family: 'Inter', 'Microsoft YaHei', sans-serif;
    scroll-behavior: smooth;
    background-color: var(--bg-gray);
    color: #1e293b;
}

/* 动画逻辑 */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.glass-nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 文案切换淡入淡出动画 */
.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

/* 交互样式 */
.tab-capsule {
    position: relative;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 9999px;
    display: inline-flex;
}

.tab-bg-slider {
    position: absolute;
    top: 4px;
    height: calc(100% - 8px);
    background: var(--primary);
    border-radius: 9999px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0, 82, 217, 0.3);
    /* 初始状态：确保有最小宽度显示 */
    min-width: 160px;
}

.tab-item {
    position: relative;
    z-index: 2;
    transition: color 0.3s;
}

.tab-item.active {
    color: white;
}

/* ==================== 产品分类选项卡移动端适配 ==================== */

/* 小屏幕手机适配 (320px - 768px) */
@media (max-width: 768px) {
    /* 选项卡容器适配 */
    .tab-capsule {
        display: flex;
        width: 100%;
        max-width: 100%;
        padding: 3px;
        border-radius: 9999px;
        overflow: hidden;
    }

    /* 滑块适配 */
    .tab-bg-slider {
        min-width: auto !important;
        height: calc(100% - 6px) !important;
        top: 3px !important;
    }

    /* 选项按钮适配 */
    .tab-item {
        flex: 1;
        padding: 0.625rem 0.25rem !important;
        font-size: 0.8125rem !important;
        white-space: nowrap;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.375rem;
        min-height: 44px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tab-item i {
        width: 1rem !important;
        height: 1rem !important;
        flex-shrink: 0;
    }

    .tab-item span {
        font-size: 0.8125rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 移动端选中状态 - 与PC端保持一致 */
    .tab-item.active {
        color: white !important;
    }

    .tab-item.active i,
    .tab-item.active span {
        color: white !important;
    }
}

/* 超小屏幕适配 (320px - 360px) */
@media (max-width: 360px) {
    .tab-item {
        padding: 0.5rem 0.125rem !important;
        font-size: 0.75rem !important;
        gap: 0.25rem;
    }

    .tab-item i {
        width: 0.875rem !important;
        height: 0.875rem !important;
    }

    .tab-item span {
        font-size: 0.75rem;
    }
}

.side-menu-item.active {
    background: #3B82F6;
    color: white;
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
}

.fade-in-image {
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.fade-in-image.loaded {
    opacity: 1;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.float-btn:hover .btn-tooltip {
    opacity: 1;
    transform: translateX(-10px);
}

.trial-bg {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
}

/* case-fade 过渡动画 */
.case-fade-enter-active,
.case-fade-leave-active {
    transition: opacity 0.3s ease;
}

.case-fade-enter-from,
.case-fade-leave-to {
    opacity: 0;
}

/* Logo动态切换样式 */
.logo-container {
    position: relative;
    height: 36px;
    display: flex;
    align-items: center;
}

.logo-white,
.logo-blue {
    max-width: 180px;
    height: 36px;
    width: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* 平板端：宽度140px */
@media (max-width: 1199px) {
    .logo-white,
    .logo-blue {
        max-width: 140px;
        height: 32px;
    }
    .logo-container {
        height: 32px;
    }
}

/* 移动端：宽度120px */
@media (max-width: 767px) {
    .logo-white,
    .logo-blue {
        max-width: 120px;
        height: 28px;
    }
    .logo-container {
        height: 28px;
    }
}

/* 个人客户案例卡片 - A/B状态切换样式 */
.personal-case-card {
    will-change: transform;
    backface-visibility: hidden;
}

.personal-case-card .card-image {
    will-change: height;
}

.personal-case-card .card-content-a,
.personal-case-card .card-content-b,
.personal-case-card .card-qrcode {
    will-change: opacity, transform;
}

/* 确保悬浮时图片不会遮挡文字 */
.personal-case-card:hover .card-image {
    z-index: 1;
}

.personal-case-card:hover .card-content-b {
    z-index: 20;
}

.personal-case-card:hover .card-qrcode {
    z-index: 20;
}

/* ==================== 案例区域移动端适配 ==================== */

/* 平板设备适配 (768px - 1024px) */
@media (max-width: 1024px) {
    .personal-case-card {
        height: 340px !important;
    }
}

/* 小屏幕手机适配 (320px - 768px) */
@media (max-width: 768px) {
    /* 案例区域容器调整 */
    #cases .flex-col {
        gap: 1rem !important;
    }

    /* 侧边菜单横向滚动优化 */
    #cases .md\:w-40 {
        width: 100% !important;
        flex-direction: row !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 0.5rem;
    }

    #cases .md\:w-40::-webkit-scrollbar {
        display: none;
    }

    /* 菜单按钮样式调整 - 优化触控体验 */
    #cases .side-menu-item {
        flex-shrink: 0;
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        white-space: nowrap;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        cursor: pointer;
    }

    #cases .side-menu-item:active {
        transform: scale(0.98);
    }

    /* 案例卡片网格调整为单列 */
    #cases .case-container {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* 案例卡片使用Flexbox布局 - 仅A状态，高度自适应 */
    #cases .personal-case-card {
        height: auto !important;
        min-height: auto;
        position: relative;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* 第一层：图片区域 */
    #cases .personal-case-card .card-image {
        position: relative;
        width: 100%;
        height: 200px !important;
        flex-shrink: 0;
    }

    #cases .personal-case-card .card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    /* 第二层：文字介绍区域 - 仅A状态，文字完整显示 */
    #cases .personal-case-card .card-content-a {
        position: relative;
        width: 100%;
        padding: 1rem !important;
        background: white;
        flex: 1;
        display: flex;
        flex-direction: column;
        /* 确保A状态始终可见 */
        opacity: 1 !important;
        transform: none !important;
    }

    #cases .card-content-a h4 {
        font-size: 1rem !important;
        margin-bottom: 0.75rem;
        line-height: 1.4;
        font-weight: 700;
    }

    #cases .card-content-a p {
        font-size: 0.875rem !important;
        line-height: 1.7;
        color: #64748b;
        /* 移除行数限制，完整显示文字 */
        display: block;
        overflow: visible;
        -webkit-line-clamp: unset;
    }

    /* 移动端隐藏B状态 - 强制使用A状态 */
    #cases .personal-case-card .card-content-b {
        display: none !important;
    }
    
    /* 禁用移动端hover效果，防止切换到B状态 */
    #cases .personal-case-card:hover .card-content-a {
        opacity: 1 !important;
        transform: none !important;
    }
    
    #cases .personal-case-card:hover .card-image {
        height: 55% !important;
    }

    /* 第三层：小程序入口区域 */
    #cases .personal-case-card .card-qrcode {
        position: relative;
        width: 100%;
        padding: 0.75rem 1rem !important;
        background: white;
        border-top: 1px solid #f1f5f9;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    /* B状态下显示小程序码 */
    #cases .personal-case-card.card-b-active .card-qrcode,
    #cases .personal-case-card:active .card-qrcode {
        opacity: 1;
        transform: translateY(0);
        z-index: 20;
    }

    #cases .personal-case-card .card-qrcode.invisible {
        display: none !important;
    }

    #cases .card-qrcode .flex-1 span {
        font-size: 0.875rem !important;
        color: #334155;
    }

    #cases .card-qrcode .w-28 {
        width: 3.5rem !important;
        height: 3.5rem !important;
    }

    /* 移动端分页指示器样式优化 */
    #cases .case-pagination-dot {
        width: 0.5rem;
        height: 0.5rem;
        min-width: 0.5rem;
        min-height: 0.5rem;
    }

    #cases .case-pagination-dot.w-6 {
        width: 1.5rem !important;
    }
}

/* 超小屏幕适配 (320px - 360px) */
@media (max-width: 360px) {
    #cases .personal-case-card {
        min-height: 380px;
    }

    #cases .personal-case-card .card-image {
        height: 180px !important;
    }

    #cases .card-content-a h4 {
        font-size: 0.9375rem !important;
    }

    #cases .card-content-a p {
        font-size: 0.75rem !important;
        -webkit-line-clamp: 5;
    }

    #cases .card-content-b h4 {
        font-size: 0.9375rem !important;
    }

    #cases .card-content-b p {
        font-size: 0.75rem !important;
        -webkit-line-clamp: 5;
    }

    #cases .card-qrcode .w-28 {
        width: 3rem !important;
        height: 3rem !important;
    }
}

/* ==================== 页面头部响应式适配 ==================== */

/* 高分辨率桌面 (>1440px) */
@media (min-width: 1441px) {
    #home {
        min-height: 80vh;
    }

    #home .max-w-7xl {
        max-width: 1400px;
    }

    #home h1 {
        font-size: 5rem;
        line-height: 1.1;
    }

    #home p {
        font-size: 1.25rem;
        max-width: 700px;
    }
}

/* 普通桌面 (1024px - 1440px) */
@media (max-width: 1440px) and (min-width: 1024px) {
    #home {
        min-height: 100vh;
    }

    #home h1 {
        font-size: 4rem;
    }

    #home p {
        font-size: 1.125rem;
    }
}

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
    #home {
        min-height: 70vh;
        padding-top: 8rem;
    }

    #home h1 {
        font-size: 3rem;
    }

    #home p {
        font-size: 1rem;
    }
}

/* 移动设备 (<768px) */
@media (max-width: 767px) {
    #home {
        min-height: auto;
        padding-top: 6rem;
        padding-bottom: 4rem;
    }

    #home h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    #home p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    #home .flex {
        flex-direction: column;
        gap: 1rem;
    }

    #home a {
        width: 100%;
        text-align: center;
    }
}

/* PC端保持原有样式 - 确保不受移动端样式影响 */
@media (min-width: 769px) {
    #cases .personal-case-card {
        height: 370px !important;
    }

    #cases .personal-case-card .card-image {
        position: absolute;
        inset: 0;
        height: 100% !important;
    }

    #cases .personal-case-card .card-content-a {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
    }

    #cases .personal-case-card .card-content-b {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        opacity: 0;
        transform: translateY(-20px);
        pointer-events: auto;
    }

    #cases .personal-case-card:hover .card-content-b {
        opacity: 1;
        transform: translateY(0);
    }

    #cases .personal-case-card .card-qrcode {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
    }
}
