/* ===========================================
   B2B生物医药落地页 - 自定义样式
   基于 Tailwind CSS 扩展
   =========================================== */

/* ===== 右侧悬浮联系按钮 ===== */
/* 产品图片淡入（排除banner背景图） */
.product-img {
    opacity: 0;
    transition: opacity 0.5s ease;
}
.product-img[src] {
    opacity: 1;
}

#float-contact.show {
    opacity: 1 !important;
    transform: translateY(-50%) translateX(0) !important;
    pointer-events: auto !important;
}

/* ===== 字体增强：标题突出 ===== */
/* 首屏标题发光光晕 */
.hero-title-glow {
    text-shadow: 0 0 40px rgba(255, 153, 0, 0.15), 0 0 80px rgba(255, 153, 0, 0.08);
}

/* ===== Banner 增强背景 ===== */
.banner-bg {
    background: 
        linear-gradient(135deg, #001a4d 0%, #003d99 35%, #0052D9 65%, #003d99 100%);
}
.banner-pattern {
    background-image: 
        linear-gradient(30deg, rgba(255,255,255,.08) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.08) 87.5%),
        linear-gradient(150deg, rgba(255,255,255,.08) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.08) 87.5%),
        linear-gradient(210deg, rgba(255,255,255,.08) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.08) 87.5%),
        linear-gradient(330deg, rgba(255,255,255,.08) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.08) 87.5%);
    background-size: 80px 140px;
}

/* ===== 自定义字体 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700;900&display=swap');

* {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', 'Source Han Sans', sans-serif;
}

/* ===== 滚动渐入动画 ===== */
/* 基础：向上滑动 + 淡入 */
.scroll-animate {
    opacity: 0;
    transform: translateY(50px) scale(0.96);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 从左侧滑入 */
.scroll-animate-left {
    opacity: 0;
    transform: translateX(-50px) scale(0.96);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.scroll-animate-left.animate-in {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* 从右侧滑入 */
.scroll-animate-right {
    opacity: 0;
    transform: translateX(50px) scale(0.96);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.scroll-animate-right.animate-in {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* 高级：模糊淡入（用于section头部标题） */
.scroll-animate-blur {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(4px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.scroll-animate-blur.animate-in {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* 高级：弹出缩放（用于卡片） */
.scroll-animate-card {
    opacity: 0;
    transform: translateY(40px) scale(0.92);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.scroll-animate-card.animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ===== 呼吸按钮动画 ===== */
@keyframes breathe {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 153, 0, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px 8px rgba(255, 153, 0, 0.25);
        transform: scale(1.03);
    }
}

.btn-breathe {
    animation: breathe 2.5s ease-in-out infinite;
}

.btn-breathe:hover {
    animation: none;
    transform: scale(1.05);
    box-shadow: 0 0 30px 12px rgba(255, 153, 0, 0.35);
}

/* ===== 分子浮动动画 ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-15px) rotate(1deg);
    }
    66% {
        transform: translateY(-8px) rotate(-1deg);
    }
}

@keyframes float-delayed {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(-0.5deg);
    }
    66% {
        transform: translateY(-10px) rotate(0.5deg);
    }
}

.molecule-float {
    animation: float 8s ease-in-out infinite;
}

.molecule-float-delayed {
    animation: float-delayed 10s ease-in-out infinite;
    animation-delay: 2s;
}

/* ===== 微粒子动画 ===== */
@keyframes particle-drift {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    20% {
        opacity: 0.6;
    }
    80% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-120px) translateX(30px);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(16, 142, 233, 0.6);
    animation: particle-drift 6s ease-in-out infinite;
}

.particle:nth-child(2n) {
    width: 3px;
    height: 3px;
    background: rgba(0, 181, 120, 0.5);
    animation-duration: 8s;
    animation-delay: 1s;
}

.particle:nth-child(3n) {
    width: 5px;
    height: 5px;
    background: rgba(255, 153, 0, 0.4);
    animation-duration: 7s;
    animation-delay: 3s;
}

/* ===== 金黄色高光扫过效果 ===== */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.btn-shimmer {
    background: linear-gradient(90deg, #FF9900, #FFB84D, #FF9900, #FFB84D);
    background-size: 200% 100%;
    animation: shimmer 2.5s linear infinite;
}

.btn-shimmer:hover {
    animation: none;
    background: linear-gradient(90deg, #e68a00, #ffaa33);
}

/* ===== 表单输入框焦点 ===== */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 82, 217, 0.2);
    border-color: #0052D9;
}

/* ===== 卡片悬浮效果 ===== */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 82, 217, 0.12);
}

/* ===== 移动端汉堡菜单 ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-open {
    animation: slideDown 0.3s ease-out forwards;
}

/* ===== 参数表格 ===== */
.param-table {
    width: 100%;
    border-collapse: collapse;
}

.param-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f4f8;
    font-size: 0.875rem;
    line-height: 1.6;
}

.param-table td:first-child {
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    width: 100px;
}

.param-table td:last-child {
    color: #1e293b;
    font-weight: 500;
}

/* ===== 证书堆叠效果 ===== */
@keyframes certificate-stack {
    0% {
        transform: rotate(-2deg) translateY(0);
    }
    50% {
        transform: rotate(-2deg) translateY(-8px);
    }
    100% {
        transform: rotate(-2deg) translateY(0);
    }
}

.cert-stack {
    position: relative;
}

.cert-stack .cert-item {
    transition: transform 0.3s ease;
}

.cert-stack .cert-item:hover {
    transform: translateY(-8px) rotate(0deg) !important;
}

/* ===== 标签横向滚动（移动端） ===== */
.tag-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tag-scroll::-webkit-scrollbar {
    display: none;
}

/* ===== 授权墙奖牌 ===== */
@keyframes medal-glow {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(255, 153, 0, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(255, 153, 0, 0.6));
    }
}

.medal-glow {
    animation: medal-glow 3s ease-in-out infinite;
}

/* ===== loading状态 ===== */
.component-loading {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* ===== 移动端底部导航条 ===== */
@media (max-width: 767px) {
    .mobile-sticky-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 40;
        background: white;
        padding: 10px 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }
}

/* ===== 桌面端圆角调整 ===== */
@media (min-width: 768px) {
    .param-table td {
        padding: 14px 20px;
        font-size: 0.9375rem;
    }

    .param-table td:first-child {
        width: 130px;
    }
}

/* ===== 表单提交成功/失败状态 ===== */
.form-success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.form-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.form-error.visible {
    display: block;
}

/* ===== 禁止超出宽度 ===== */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* ===== Banner首图在不同屏幕的自适应 ===== */
/* 手机端用 contain 显示完整图片，桌面用 cover 填满 */
.banner-img {
    object-fit: contain;
    object-position: center;
}

@media (min-width: 768px) {
    .banner-img {
        object-fit: cover;
    }
}

/* ===== 图片自适应（管理面板上传后兼容各尺寸） ===== */
/* 产品图片容器：aspect-ratio 自适应，不设固定高度避免冲突 */
.product-img-wrap {
    aspect-ratio: 4/3;
}

/* GMP 车间图片自适应 */
.gmp-img-wrap {
    aspect-ratio: 16/7;
    max-height: 420px;
}

@media (max-width: 767px) {
    .gmp-img-wrap {
        aspect-ratio: 16/9;
        max-height: 260px;
    }
}

/* 管理面板预览图片在移动端自适应 */
@media (max-width: 480px) {
    #admin-panel {
        width: 100vw;
        max-width: 100vw;
    }
    .admin-preview {
        height: 70px !important;
    }
}

/* ===== 横向滚动画廊 ===== */
.gallery-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #0052D9 #e5e7eb;
}

.gallery-scroll::-webkit-scrollbar {
    height: 5px;
}
.gallery-scroll::-webkit-scrollbar-track {
    background: #e5e7eb;
    border-radius: 10px;
}
.gallery-scroll::-webkit-scrollbar-thumb {
    background: #0052D9;
    border-radius: 10px;
}

.gallery-item {
    flex: 0 0 auto;
    width: 240px;
    min-height: 420px;
    border-radius: 12px;
    overflow: hidden;
    scroll-snap-align: start;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 82, 217, 0.15);
}

@media (max-width: 767px) {
    .gallery-item {
        width: 220px;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .gallery-item {
        width: 180px;
        height: 130px;
    }
}
