/* === CHEMBULL Custom Styles (extracted from demo) === */
/* @import 必须放在所有其他规则之前 */
@import url('/css/inter-fonts.css');
[hidden] { display: none !important; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; overflow-x: hidden; background: #ffffff; }

/* Hero */
.hero-section { position: relative; height: 100vh; overflow: hidden; background: linear-gradient(180deg, #E6F2FF 0%, #F5F7FA 50%, #F5F7FA 100%); }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Machinery Cards */
.machinery-card { transition: all 200ms ease-in-out; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.machinery-card:hover { transform: translateY(-4px); border-color: #0099E5; box-shadow: 0 8px 24px rgba(22, 93, 255, 0.08); }
.machinery-card:hover svg { color: #0066CC; }

/* Product Card Horizontal */
.product-card-horizontal { display: flex; flex-direction: column; transition: all 0.3s ease; }
.product-card-horizontal:hover { transform: translateY(-2px); }

/* Filter dropdown animation */
[id^="filter-"] { animation: fadeIn 0.15s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Navigation */
#navbar { transition: all 0.3s ease-in-out; background: transparent; }
#navbar.scrolled { background: rgba(255, 255, 255, 0.98); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); }
#navbar.scrolled .nav-text { color: #4A4A4A; }
#navbar:not(.scrolled) .nav-text { color: #4A4A4A; }
#navbar:not(.scrolled) .nav-text:hover { color: #0099E5; }
#navbar:not(.scrolled) .dropdown-trigger .nav-text { color: #4A4A4A; }
#navbar.scrolled .nav-logo-text { color: #0099E5; }
#navbar:not(.scrolled) .nav-logo-text { color: #0099E5; }
#navbar:not(.scrolled) a.nav-text { color: #4A4A4A; }
#navbar:not(.scrolled) a.nav-text:hover { color: #0099E5; }
#navbar.scrolled .lookingplas-link { color: #4E5969; }
#navbar.scrolled .lookingplas-link:hover { color: #0066CC; }
.nav-item { position: relative; cursor: pointer; }
.nav-text { font-size: 16px; }
.nav-item::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: currentColor; transition: width 0.2s ease-in-out; }
.nav-item:hover::after { width: 100%; }

/* Dropdown */
.dropdown-menu { opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s ease-in-out; }
.dropdown-trigger:hover .dropdown-menu, .dropdown-menu:hover { opacity: 1; visibility: visible; transform: translateY(0); }

/* Cards */
.feature-card { transition: all 0.3s ease; }
.feature-card:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 1); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15); }
.product-card { transition: all 0.3s ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1); }
.product-card .action-buttons { opacity: 0; transform: translateY(10px); transition: all 0.3s ease; }
.product-card:hover .action-buttons { opacity: 1; transform: translateY(0); }

/* Buttons */
.btn-primary { background: #0099E5; color: white; border-radius: 8px; transition: all 0.2s ease; border: none; cursor: pointer; }
.btn-primary:hover { background: #0077CC; }
.btn-primary:active { background: #0066CC; }
.btn-secondary { background: white; color: #0099E5; border: 1px solid #0099E5; border-radius: 8px; transition: all 0.2s ease; cursor: pointer; }
.btn-secondary:hover { background: #E6F2FF; }

/* 首页白字按钮悬停修正：基础 .text-white(0,1,0) 高于 a(0,0,1)，但全局 a:hover(0,1,1) 会压过 .text-white，
   导致 Ask ChemAI / View All Materials / Browse Materials 悬停变蓝；补齐同色 hover 规则 */
a.text-white:hover {
    color: #fff;
}

/* 首页产品卡图片：固定高度 188px */
#hot-products-grid .product-img-box {
    height: 188px;
}

/* ChemAI 右侧悬浮按钮（样式 1:1 移植自 static/dome.html .ai-fab） */
.ai-fab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    display: flex;
    align-items: center;
    height: 46px;
    padding: 0 15px;
    border: none;
    border-radius: 23px 0 0 23px;
    background: linear-gradient(135deg, #0099E5 0%, #0077CC 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: -4px 4px 16px rgba(0, 119, 204, 0.3);
    transition: box-shadow 0.25s;
    white-space: nowrap;
}
.ai-fab:hover {
    box-shadow: -6px 6px 22px rgba(0, 119, 204, 0.45);
    color: #fff;
}
.ai-fab svg { width: 18px; height: 18px; flex-shrink: 0; }
.ai-fab-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.3s ease, opacity 0.25s ease, margin 0.3s ease;
}
.ai-fab:hover .ai-fab-label {
    max-width: 80px;
    opacity: 1;
    margin-left: 8px;
}

/* Modal */
.modal-overlay { opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { transform: scale(0.95) translateY(20px); transition: all 0.3s ease; }
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }

/* AI Chat */
.chat-message { animation: fadeInUp 0.3s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.typing-indicator span { animation: typingBounce 1.4s infinite ease-in-out both; }
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typingBounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* Loading Skeleton */
.skeleton { background: linear-gradient(90deg, #F5F7FA 25%, #D9D9D9 50%, #F5F7FA 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Toast */
.toast { animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(100%); } }

/* Tab Active */
.tab-active { color: #0099E5; border-bottom: 2px solid #0099E5; }

/* Media Logo Hover */
.media-logo { transition: all 0.3s ease; filter: grayscale(100%); opacity: 0.6; }
.media-logo:hover { transform: scale(1.1); filter: grayscale(0%); opacity: 1; }

/* Smooth Scroll */
html { scroll-behavior: smooth; }

/* Mobile Menu */
.mobile-menu { transform: translateX(-100%); transition: transform 0.3s ease; }
.mobile-menu.open { transform: translateX(0); }

/* Comparison */
.diff-highlight { background: rgba(245, 63, 63, 0.1); color: #F53F3F; font-weight: 600; }

/* Form Focus */
input:focus, textarea:focus, select:focus { outline: none; border-color: #0099E5; box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.15); }

/* Stock Tags */
.tag-instock { background: #E6F2FF; color: #00B42A; }
.tag-preorder { background: #E6F2FF; color: #0066CC; }
.tag-outstock { background: #FFECE8; color: #F53F3F; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #F5F7FA; }
::-webkit-scrollbar-thumb { background: #D9D9D9; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* Breadcrumb */
.breadcrumb-item:hover { color: #0099E5; }

/* Video Preview */
.video-card:hover .video-preview { opacity: 1; }

/* Sticky Sidebar */
.sticky-sidebar { position: sticky; top: 100px; }

/* Range Slider */
input[type="range"] { -webkit-appearance: none; height: 6px; background: #D9D9D9; border-radius: 3px; outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: #0099E5; border-radius: 50%; cursor: pointer; }

/* Tech Backgrounds */
.tech-bg-1 { background-color: #F5F7FA; background-image: linear-gradient(rgba(22,93,255,0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(22,93,255,0.018) 1px, transparent 1px); background-size: 48px 48px; }
.tech-bg-2 { background-color: #F5F7FA; background-image: radial-gradient(rgba(22,93,255,0.035) 1px, transparent 0); background-size: 24px 24px; }
.tech-bg-8 { background: linear-gradient(135deg, #E6F2FF 0%, #F5F7FA 50%, #E6F2FF 100%); }

/* Category Nav */
.cat-nav { transition: all 0.15s ease; }
.cat-nav.active { background: #0099E5; color: #ffffff; }
.cat-nav.active .text-gray-400 { color: rgba(255,255,255,0.7); }
.cat-nav.active .rounded-full { background: #ffffff !important; }
.cat-nav:hover:not(.active) { background: #E6E6E6; }

/* View Button */
.view-btn { transition: all 0.15s ease; }
.view-btn.active { background: #0099E5; color: #ffffff; }

/* Insights Card */
.insights-card { transition: all 0.2s ease; }
.insights-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); border-color: rgba(22, 93, 255, 0.2); }

/* About Service Card */
.about-service-card { transition: all 0.3s ease; }
.about-service-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(22, 93, 255, 0.12); border-color: rgba(22, 93, 255, 0.2); }

/* Certification badges */
.cert-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.cert-iso { background: #E8F5E9; color: #2E7D32; }
.cert-fda { background: #E6F2FF; color: #0066CC; }
.cert-rohs { background: #E6F2FF; color: #0055AA; }
.cert-reach { background: #F3E5F5; color: #6A1B9A; }
.cert-ul { background: #D9D9D9; color: #37474F; }
.cert-food { background: #E0F2F1; color: #00695C; }

/* Chembull Card */
.chembull-card { background: white; border-radius: 12px; border: 1px solid #E6F2FF; transition: all 0.3s ease; }
.chembull-card:hover { border-color: rgba(22, 93, 255, 0.3); box-shadow: 0 2px 8px rgba(22, 93, 255, 0.08); }

/* Scroll arrow animation */
@keyframes scrollArrowBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.scroll-arrow-anim { animation: scrollArrowBounce 1.5s ease-in-out infinite; }

/* Cat tag */
.cat-tag.active { background: #0099E5; color: #ffffff; border-color: #0099E5; }
/* ========================================
   CHEMBULL 自定义样式
   基于 Bootstrap 4，补充 Thymeleaf 模板样式
   ======================================== */

/* ---------- 全局 ---------- */
body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #303133;
    background-color: #f5f7fa;
}

a {
    color: #409eff;
    text-decoration: none;
}
a:hover {
    color: #66b1ff;
    text-decoration: none;
}

/* Footer 子导航 + Contact 栏文字统一米色（覆盖全局 a/a:hover 蓝色），与主题浅字保持一个色调 */
footer ul a {
    color: #EDE4D3;
}
footer ul a:hover {
    color: #fff;
}
.cb-footer-info {
    color: #EDE4D3;
}

/* ---------- Header 顶部栏 ---------- */
.cb-header {
    background-color: #fff;
    border-bottom: 1px solid #ebeef5;
    height: 40px;
    line-height: 40px;
    font-size: 12px;
}
.cb-header-bar {
    padding: 0;
}
.cb-header-link {
    color: #606266;
    margin: 0 4px;
}
.cb-header-link:hover {
    color: #409eff;
}
.cb-header-text {
    color: #909399;
    margin: 0 6px;
}
.cb-header-divider {
    color: #dcdfe6;
    margin: 0 6px;
}

/* ---------- Nav 主导航 ---------- */
.cb-nav {
    background-color: #fff;
    border-bottom: 2px solid #409eff;
    height: 110px;
    line-height: 110px;
}
.cb-nav-logo {
    display: flex;
    align-items: center;
}
.cb-nav-logo-img {
    height: 48px;
    max-width: 180px;
    object-fit: contain;
}
.cb-nav-menu {
    display: flex;
    gap: 0;
}
.cb-nav-item {
    color: #303133;
    font-size: 16px;
    font-weight: 500;
    padding: 0 24px;
    transition: color 0.2s;
    white-space: nowrap;
}
.cb-nav-item:hover {
    color: #409eff;
}

/* ---------- Search 搜索栏 ---------- */
.cb-search {
    background-color: #409eff;
    padding: 12px 0;
}
.cb-search-form {
    max-width: 600px;
    margin: 0 auto;
}
.cb-search-input {
    border-radius: 20px 0 0 20px;
    border: none;
    height: 40px;
    font-size: 14px;
}
.cb-search-input:focus {
    box-shadow: none;
    border-color: #409eff;
}
.cb-search-btn {
    border-radius: 0 20px 20px 0;
    height: 40px;
    padding: 0 24px;
    background-color: #303133;
    border-color: #303133;
    font-size: 14px;
}
.cb-search-btn:hover {
    background-color: #606266;
    border-color: #606266;
}

/* ---------- Banner 轮播区 ---------- */
.cb-banner {
    background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
    color: #fff;
    padding: 60px 0;
}
.cb-banner h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
}
.cb-banner p {
    font-size: 16px;
    opacity: 0.85;
}

/* ---------- Home Content ---------- */
.cb-home-content {
    min-height: 300px;
    background-color: #fff;
}

/* ---------- Footer 底部 ---------- */
.cb-footer {
    background-color: #2c3e50;
    color: #bdc3c7;
    font-size: 13px;
    margin-top: 40px;
}
.cb-footer-main {
    padding: 40px 0 20px;
}
.cb-footer-section {
    margin-bottom: 20px;
}
.cb-footer-logo {
    width: 200px;
    opacity: 0.85;
}
.cb-footer-title {
    color: #ecf0f1;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    border-bottom: 1px solid #34495e;
    padding-bottom: 6px;
}
.cb-footer-links a,
.cb-footer-nav a,
.cb-footer-partners a {
    color: #bdc3c7;
    font-size: 13px;
}
.cb-footer-links a:hover,
.cb-footer-nav a:hover,
.cb-footer-partners a:hover {
    color: #409eff;
}
.cb-footer-divider {
    color: #7f8c8d;
    margin: 0 8px;
}
.cb-footer-social a {
    color: #bdc3c7;
    transition: color 0.2s;
}
.cb-footer-social a:hover {
    color: #409eff;
}
.cb-footer-qr {
    width: 100px;
    height: 100px;
    margin: 0 8px;
    border-radius: 4px;
    object-fit: cover;
}
.cb-footer-copyright {
    background-color: #1a252f;
    padding: 12px 0;
    font-size: 12px;
    color: #7f8c8d;
}
.cb-footer-copyright a {
    color: #95a5a6;
}
.cb-footer-copyright a:hover {
    color: #409eff;
}
