/* 全局样式 */
body {
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    line-height: 1.8;
    color: #333;
    font-size: 16px;
}

/* 导航栏样式 */
.sticky-navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    z-index: 1050; /* Increase z-index to ensure it's above other elements */
    min-height: 50px;
    padding-top: 2px;
    padding-bottom: 2px;
}

/* 悬浮吸顶导航栏 */
.sticky-navbar.sticky {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1100; /* Ensure it's above page-header even when sticky */
}

.navbar-brand img {
    height: 50px;
    width: auto;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* 下拉菜单样式 */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: block;
    transform: translateY(10px);
    margin: 0;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 10px 20px;
    transition: all 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: transparent;
    color: #e74c3c !important;
}

/* 主导航项间距 */
.navbar-nav .nav-item {
    margin-right: 5px;
}

/* 二级导航两列布局 */
.dropdown-menu.columns-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 15px;
    min-width: 400px;
}

.dropdown-menu.columns-2 .dropdown-item {
    padding: 8px 10px;
}

/* 搜索框样式 */
.search-input-group {
    width: 180px;
}

.search-input-group .form-control {
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
    border: 1px solid #ddd;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.search-input-group .btn {
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
    border: 1px solid #ddd;
    padding: 0.375rem 0.75rem;
}

/* 搜索遮罩和弹出框 */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-overlay.show {
    opacity: 1;
    visibility: visible;
}

.search-popup {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.search-overlay.show .search-popup {
    opacity: 1;
    transform: scale(1);
}

.search-popup-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.search-popup-input {
    flex: 1;
    border-radius: 25px;
    border: 1px solid #ddd;
    margin-right: 15px;
    padding: 10px 20px;
    font-size: 1rem;
}

.search-popup-close {
    font-size: 0.75rem;
    background: #f5f5f5;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    padding: 0;
}

.search-popup-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.search-result-item {
    margin-bottom: 20px;
}

.search-result-item h6 {
    color: #666;
    margin-bottom: 15px;
    font-size: 1rem;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.search-result-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-result-list li {
    margin-bottom: 10px;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.search-result-list li:hover {
    background-color: #f8f9fa;
}

.search-result-list a {
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    display: block;
}

.search-result-list a:hover {
    color: #e74c3c;
}

/* 首页轮播图样式 */
.carousel-item {
    height:70vh;
}

.carousel-item img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.carousel-caption {
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    padding: 20px;
    bottom: 30%;
    left: 10%;
    right: 10%;
}

/* 页面标题头部样式 */
.page-header {
    background: linear-gradient(135deg, #3065c1, #1a4a9d);
    padding: 150px 0; /* Increase padding to make header even taller */
    margin-bottom: 30px;
    color: white;
    text-align: center;
    box-shadow: none; /* Remove the box shadow (horizontal line) */
    margin-left: calc(-1 * var(--bs-gutter-x, 0.75rem));
    margin-right: calc(-1 * var(--bs-gutter-x, 0.75rem));
    position: relative;
    z-index: 10; /* Significantly lower z-index than navbar */
}

.page-header .page-title {
    color: white;
    margin: 0;
    font-weight: 600;
    font-size: 2.5rem;
}

/* 产品展示 */
.product-with-image {
    margin-bottom: 50px;
    padding: 40px;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    color: #333;
    background: #f8f9fa;
    min-height: 420px; /* 增加最小高度以适应更大的图片 */
    display: flex;
    flex-direction: column;
}

.product-with-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.product-with-image h3 {
    color: #2c3e50;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.product-with-image p {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 25px;
}


/* 产品图片容器 */
.product-image-container {
    height: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.product-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

/* 无图片占位符 */
.product-image-placeholder {
    height: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    width: 100%;
    border: 1px dashed #ddd;
    flex: 1;
}

.btn-custom {
    background-color: #007bff; /* 改为蓝色按钮 */
    border-color: #007bff;
    color: white;
    border-radius: 30px; /* 更圆的按钮 */
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-custom:hover {
    background-color: #0069d9;
    border-color: #0062cc;
    color: white;
    transform: translateY(-2px); /* 添加轻微的上移效果 */
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

/* 二维码图片样式 */
.qr-code-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
    background: white;
}

/* 大尺寸二维码图片样式 */
.qr-code-img-large {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
    background: white;
}

/* 页脚 */
.footer {
    background: #333;
    color: #fff;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer h5 {
    color: #e74c3c;
    margin-bottom: 20px;
}

.footer a {
    color: #ccc;
    text-decoration: none;
}

.footer a:hover {
    color: #e74c3c;
}

.footer .copyright {
    border-top: 1px solid #555;
    padding-top: 20px;
    margin-top: 30px;
    text-align: center;
}

.footer-logo {
    max-width: 200px;
    height: auto;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
}

.footer-links a:hover {
    color: #e74c3c;
    text-decoration: underline;
}

/* ===== Dark Theme Styles (ENCY Robotics style) ===== */

/* Body dark theme */
body {
    background-color: #0a0a0a;
    color: #ccc;
}

/* Header & Nav - matches encyrobotics.com */
.ency-header {
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1050;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ency-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ency-logo {
    color: #00bcd4;
    font-size: 28px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.ency-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

.ency-logo:hover {
    color: #00e5ff;
}

.ency-nav {
    display: flex;
    align-items: center;
}

.ency-nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.ency-nav-link-wrapper {
    position: relative;
}

.ency-nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    padding: 0 18px;
    transition: color 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.ency-nav-link:hover {
    color: #00bcd4;
}

.ency-nav-link.active {
    color: #00bcd4;
}

.ency-nav-sep {
    color: rgba(255,255,255,0.3);
    font-size: 14px;
    user-select: none;
}

/* 汉堡菜单按钮 - 默认在PC端隐藏 */
.ency-menu-toggle {
    display: none;
}

/* Dropdown Menu */
.ency-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 130px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.ency-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ency-dropdown-item {
    display: block;
    padding: 8px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    white-space: nowrap;
    transition: all 0.2s;
}

.ency-dropdown-item:hover {
    background-color: #f5f5f5;
    color: #00bcd4;
}

/* Remove old navbar styles that are no longer used */
.ency-navbar,
.navbar-brand,
.dropdown-menu,
.dropdown-item,
.navbar-nav,
.nav-item,
.nav-link,
.dropdown-toggle::after,
.navbar-toggler,
.navbar-toggler-icon {
    display: none;
}

/* Hero carousel dark */
.hero-carousel {
    background-color: #0a0a0a;
}

.hero-carousel .carousel-indicators button {
    background-color: rgba(255, 255, 255, 0.5);
}

.hero-carousel .carousel-indicators .active {
    background-color: #fff;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(1);
}

.hero-video,
.hero-image {
    opacity: 0.85;
}

/* Products section dark */
.products-section {
    background-color: #0a0a0a;
    padding: 60px 0;
    border-top: 1px solid #222;
}

.products-section .section-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.products-section .section-subtitle {
    color: #888;
    font-size: 16px;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

/* Product cards dark */
.product-card {
    background-color: #111;
    border: 1px solid #222;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.product-card:hover {
    border-color: #444;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.product-image-wrapper {
    background-color: #1a1a1a;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #222;
}

.product-image-wrapper img {
    max-height: 200px;
    width: auto;
    object-fit: contain;
}

.product-content {
    padding: 20px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.product-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.product-title a:hover {
    color: #667eea;
}

.product-summary {
    color: #888;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.product-link {
    color: #667eea;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.3s;
}

.product-link:hover {
    color: #764ba2;
}

/* News section dark */
.news-section {
    background-color: #111;
    padding: 60px 0;
    border-top: 1px solid #222;
}

.news-section .section-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
}

.news-card {
    background-color: #1a1a1a;
    border: 1px solid #222;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.news-card:hover {
    border-color: #444;
}

.news-image-wrapper {
    background-color: #222;
    overflow: hidden;
}

.news-image-wrapper img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-card:hover .news-image-wrapper img {
    transform: scale(1.05);
}

.news-content {
    padding: 20px;
}

.news-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-summary {
    color: #888;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 10px;
}

.news-meta {
    margin-bottom: 10px;
}

.news-meta .text-muted {
    color: #666 !important;
}

.news-link {
    color: #667eea;
    font-size: 15px;
    text-decoration: none;
}

.news-link:hover {
    color: #764ba2;
}

.view-more-btn {
    color: #667eea !important;
    border-color: #667eea !important;
}

.view-more-btn:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: #fff !important;
}

/* Case section dark */
.case-section {
    background-color: #0a0a0a;
    padding: 60px 0;
    border-top: 1px solid #222;
}

.case-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    padding: 40px;
    border: 1px solid #222;
}

.case-title {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.case-subtitle {
    color: #667eea;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.case-description {
    color: #888;
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.case-btn {
    background-color: #667eea;
    border-color: #667eea;
}

.case-btn:hover {
    background-color: #5a6fd6;
    border-color: #5a6fd6;
}

/* Contact section dark */
.contact-section {
    background-color: #0a0a0a;
    padding: 60px 0;
    border-top: 1px solid #222;
}

.contact-content .contact-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.5;
}

.contact-btn {
    background-color: #28a745;
    border-color: #28a745;
}

.contact-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.contact-info .card {
    background-color: #1a1a1a;
    border-color: #333;
}

.contact-info .card-title {
    color: #fff;
    font-weight: 600;
}

.contact-info .card-text {
    color: #888;
    font-size: 15px;
}

/* Footer dark */
.footer {
    background-color: #000;
    border-top: 1px solid #222;
}

.footer h5 {
    color: #667eea;
    font-size: 1rem;
    font-weight: 600;
}

.footer-links a,
.footer a {
    color: #888;
    font-size: 15px;
}

.footer-links a:hover,
.footer a:hover {
    color: #fff;
}

.footer .contact-info p,
.footer .contact-info a {
    color: #888;
    font-size: 15px;
}

.footer .contact-info a:hover {
    color: #fff;
}

.footer .company-description {
    color: #888;
    font-size: 15px;
    line-height: 1.8;
}

.footer hr {
    border-color: #222 !important;
}

.footer .copyright p {
    color: #666;
    font-size: 15px;
}

/* Buttons dark theme */
.btn-outline-primary {
    color: #667eea;
    border-color: #667eea;
}

.btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: #fff;
}

.btn-primary {
    background-color: #667eea;
    border-color: #667eea;
}

.btn-primary:hover {
    background-color: #5a6fd6;
    border-color: #5a6fd6;
}

.btn-light {
    background-color: #fff;
    color: #000;
    border-color: #fff;
}

.btn-light:hover {
    background-color: #e0e0e0;
    border-color: #e0e0e0;
}

.btn-outline-primary {
    color: #667eea;
    border-color: #667eea;
}

.btn-outline-primary:hover {
    background-color: #667eea;
    color: #fff;
}

/* Override Bootstrap card styles */
.card {
    background-color: #1a1a1a;
    border-color: #333;
}

.card-body {
    color: #ccc;
}

.card-title {
    color: #fff;
}

.card-text {
    color: #888;
}

/* Alert dark */
.alert-info {
    background-color: #1a2a3a;
    border-color: #2a3a4a;
    color: #8ab4f8;
}

/* Section title override */
.section-title {
    color: #fff !important;
}

/* H5 移动端响应式样式 */
@media (max-width: 768px) {
    /* 汉堡菜单按钮 */
    .ency-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
        position: relative;
    }
    
    .menu-bar {
        width: 100%;
        height: 3px;
        background-color: #fff;
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    
    /* 汉堡菜单激活状态 - X形状 */
    .ency-menu-toggle.active .menu-bar:nth-child(1) {
        transform: translateY(10.5px) rotate(45deg);
    }
    
    .ency-menu-toggle.active .menu-bar:nth-child(2) {
        opacity: 0;
    }
    
    .ency-menu-toggle.active .menu-bar:nth-child(3) {
        transform: translateY(-10.5px) rotate(-45deg);
    }
    
    /* Logo调整 */
    .ency-logo img {
        height: 40px !important;
    }
    
    /* 导航容器 */
    .ency-nav-container {
        padding: 15px 20px;
        position: relative;
    }
    
    /* 移动端导航菜单 */
    .ency-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 1000;
    }
    
    .ency-nav.mobile-open {
        left: 0;
    }
    
    /* 移动端导航项 */
    .ency-nav-item {
        width: 100%;
        margin: 5px 0;
    }
    
    .ency-nav-link {
        display: block;
        padding: 15px 0;
        font-size: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .ency-nav-sep {
        display: none;
    }
    
    /* 移动端下拉菜单 */
    .ency-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        display: none;
        background-color: rgba(255, 255, 255, 0.05);
        margin-top: 10px;
        padding: 10px 0;
        box-shadow: none;
        transform: none;
        min-width: auto;
    }
    
    .ency-dropdown.show {
        display: block;
    }
    
    .ency-dropdown-item {
        display: block;
        padding: 12px 20px;
        font-size: 16px;
        color: #ccc;
        border-left: 3px solid transparent;
    }
    
    .ency-dropdown-item:hover,
    .ency-dropdown-item:active {
        background-color: rgba(255, 255, 255, 0.1);
        color: #00bcd4;
        border-left-color: #00bcd4;
    }
    
    /* 禁用hover效果，使用点击展开 */
    .ency-nav-link-wrapper:hover .ency-dropdown {
        display: none;
    }
    
    .ency-nav-link-wrapper:hover .ency-dropdown.show {
        display: block;
    }
}