/* ============================================
   Common CSS - Header & Footer Styles
   Cangzhou Xinghui Pipeline Equipment Co., Ltd.
   ============================================ */

/* Skip Link for Accessibility */
.xinghui-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1e3c72;
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s ease;
}

.xinghui-skip-link:focus {
    top: 0;
}

/* Page Loader */
.xinghui-page-loading {
    overflow: hidden;
}

.xinghui-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.xinghui-page-loader.xinghui-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.xinghui-loader-content {
    text-align: center;
    color: #fff;
}

.xinghui-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: xinghui-spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes xinghui-spin {
    to { transform: rotate(360deg); }
}

.xinghui-loader-content p {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 2px;
    animation: xinghui-pulse 1.5s ease-in-out infinite;
}

@keyframes xinghui-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

ul {
    list-style: none;
}

/* Container */
.xinghui-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Header Styles
   ============================================ */
.xinghui-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Top Bar */
.xinghui-topbar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.xinghui-topbar .xinghui-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xinghui-topbar-left {
    display: flex;
    gap: 25px;
}

.xinghui-topbar-item {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.xinghui-topbar-item:hover {
    color: #fff;
}

.xinghui-topbar-item i {
    font-size: 14px;
}

.xinghui-topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.xinghui-language-select {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    outline: none;
}

.xinghui-language-select option {
    background: #1e3c72;
    color: #fff;
}

.xinghui-social-icons {
    display: flex;
    gap: 12px;
}

.xinghui-social-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.xinghui-social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
}

/* Main Header */
.xinghui-main-header {
    padding: 15px 0;
    background: #fff;
}

.xinghui-main-header .xinghui-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xinghui-logo img {
    height: 60px;
    width: auto;
}

/* Navigation */
.xinghui-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.xinghui-nav-menu {
    display: flex;
    gap: 0;
}

.xinghui-nav-item {
    position: relative;
}

.xinghui-nav-item > a {
    display: block;
    padding: 15px 20px;
    color: #333;
    font-weight: 500;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    transition: all 0.3s ease;
}

.xinghui-nav-item > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    transition: width 0.3s ease;
}

.xinghui-nav-item:hover > a::after,
.xinghui-active > a::after {
    width: 80%;
}

.xinghui-nav-item:hover > a {
    color: #1e3c72;
}

.xinghui-nav-item > a i {
    font-size: 12px;
    margin-left: 5px;
}

/* Dropdown Menu */
.xinghui-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.xinghui-has-dropdown:hover .xinghui-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.xinghui-dropdown li a {
    display: block;
    padding: 12px 20px;
    color: #333;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.xinghui-dropdown li:last-child a {
    border-bottom: none;
}

.xinghui-dropdown li a:hover {
    background: #f8f9fa;
    color: #1e3c72;
    padding-left: 25px;
}

/* Search Box */
.xinghui-search-box {
    display: flex;
    align-items: center;
}

.xinghui-search-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
}

.xinghui-search-btn:hover {
    color: #1e3c72;
}

/* Search Modal */
.xinghui-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s ease;
}

.xinghui-search-modal.xinghui-active {
    opacity: 1;
    visibility: visible;
}

.xinghui-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.xinghui-search-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    top: 30%;
    transform: translateY(-30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xinghui-search-modal.xinghui-active .xinghui-search-container {
    transform: translateY(0) scale(1);
}

.xinghui-search-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    padding: 10px;
    transition: all 0.3s ease;
}

.xinghui-search-close:hover {
    transform: rotate(90deg);
    color: #2a5298;
}

.xinghui-search-form {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.xinghui-search-input {
    flex: 1;
    padding: 20px 30px;
    border: none;
    outline: none;
    font-size: 18px;
    color: #333;
    background: transparent;
}

.xinghui-search-input::placeholder {
    color: #999;
}

.xinghui-search-submit {
    padding: 20px 30px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.xinghui-search-submit:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
}

/* Mobile Menu Toggle */
.xinghui-mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.xinghui-mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    transition: all 0.3s ease;
}

/* ============================================
   Footer Styles
   ============================================ */
.xinghui-footer {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    padding: 60px 0 0;
    margin-top: 80px;
}

.xinghui-footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.xinghui-footer-section h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #fff;
    position: relative;
    padding-bottom: 10px;
}

.xinghui-footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: #fff;
}

.xinghui-footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    font-size: 14px;
    margin-bottom: 20px;
}

.xinghui-footer-section ul li {
    margin-bottom: 12px;
}

.xinghui-footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    transition: all 0.3s ease;
}

.xinghui-footer-section ul li a:hover {
    color: #fff;
    padding-left: 5px;
}

.xinghui-footer-contact li {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.xinghui-footer-contact li i {
    width: 16px;
    text-align: center;
}

/* Footer Social Icons */
.xinghui-footer-social {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.xinghui-footer-social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.xinghui-footer-social-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.xinghui-footer-bottom {
    padding: 20px 0;
    text-align: center;
}

.xinghui-footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .xinghui-nav-menu {
        gap: 0;
    }
    
    .xinghui-nav-item > a {
        padding: 15px 15px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .xinghui-topbar-left {
        flex-direction: column;
        gap: 8px;
    }
    
    .xinghui-topbar-right {
        flex-direction: column;
        gap: 10px;
    }

    .xinghui-main-header .xinghui-container {
        flex-wrap: wrap;
        position: relative;
    }

    .xinghui-logo {
        flex: 1;
    }

    .xinghui-nav {
        order: 3;
        width: 100%;
        display: none;
        flex-direction: column;
        background: #fff;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        margin-top: 15px;
        padding: 15px 0;
    }

    .xinghui-nav.xinghui-active {
        display: flex;
    }

    .xinghui-nav-menu {
        flex-direction: column;
        width: 100%;
    }

    .xinghui-nav-item > a {
        padding: 12px 20px;
        border-bottom: 1px solid #f0f0f0;
    }

    .xinghui-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        display: none;
        background: #f8f9fa;
    }

    .xinghui-has-dropdown.xinghui-dropdown-open .xinghui-dropdown {
        display: block;
    }

    .xinghui-search-box {
        order: 2;
    }

    .xinghui-mobile-menu-toggle {
        display: flex;
        order: 2;
    }

    .xinghui-footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .xinghui-logo img {
        height: 45px;
    }

    .xinghui-language-select {
        font-size: 12px;
        padding: 5px 8px;
    }

    .xinghui-topbar-item {
        font-size: 12px;
    }
    
    .xinghui-search-container {
        top: 25%;
    }
    
    .xinghui-search-input {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .xinghui-search-submit {
        padding: 15px 20px;
        font-size: 18px;
    }
    
    .xinghui-search-close {
        top: -40px;
        font-size: 28px;
    }
}

/* ============================================
   Online Service Float Panel
   ============================================ */
.xinghui-online-service {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999999;
    display: flex;
    align-items: center;
}

.xinghui-service-toggle {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: xinghui-pulse-glow 2s ease-in-out infinite;
}

@keyframes xinghui-pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(30, 60, 114, 0.5);
    }
}

.xinghui-service-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.5);
}

.xinghui-service-panel {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%) translateX(20px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    z-index: 999999;
}

.xinghui-online-service:hover .xinghui-service-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.xinghui-service-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.xinghui-service-item {
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.xinghui-service-item:last-child {
    border-bottom: none;
}

.xinghui-service-item a,
.xinghui-service-item button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.xinghui-service-item a:hover,
.xinghui-service-item button:hover {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
}

.xinghui-service-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    transition: transform 0.3s ease;
}

.xinghui-service-item:hover i {
    transform: scale(1.2);
}

.xinghui-service-text {
    font-weight: 500;
}

/* WeChat QR Code Popup */
.xinghui-wechat-qrcode {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    min-width: 180px;
    text-align: center;
    z-index: 999999;
    white-space: nowrap;
}

.xinghui-service-item:hover .xinghui-wechat-qrcode {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-20px);
    pointer-events: auto;
}

.xinghui-wechat-qrcode img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.xinghui-wechat-qrcode p {
    margin: 0;
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Responsive Design for Online Service */
@media (max-width: 768px) {
    .xinghui-online-service {
        right: 10px;
    }
    
    .xinghui-service-toggle {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .xinghui-service-panel {
        right: 55px;
    }
    
    .xinghui-service-item a,
    .xinghui-service-item button {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .xinghui-wechat-qrcode {
        min-width: 150px;
    }
    
    .xinghui-wechat-qrcode img {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 480px) {
    .xinghui-online-service {
        right: 5px;
    }
    
    .xinghui-service-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .xinghui-service-panel {
        right: 50px;
    }
    
    .xinghui-service-item a,
    .xinghui-service-item button {
        padding: 10px 12px;
        font-size: 12px;
        gap: 8px;
    }
    
    .xinghui-service-item i {
        font-size: 16px;
        width: 20px;
    }
    
    .xinghui-wechat-qrcode {
        min-width: 130px;
        padding: 10px;
    }
    
    .xinghui-wechat-qrcode img {
        width: 100px;
        height: 100px;
    }
    
    .xinghui-wechat-qrcode p {
        font-size: 11px;
    }
}
