/*
Theme Name: 企业官网主题
Theme URI: 
Author: 
Author URI: 
Description: 一个使用 HTML、CSS、JavaScript 和 Bootstrap 5 框架构建的现代化响应式企业官网主题。包含响应式设计、平滑滚动动画、交互式导航栏、作品展示区域、联系表单等功能。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: qiyeguanwangzhuti
Tags: responsive, bootstrap, modern, business, corporate
*/

/* 
 * 主样式文件
 * 主题样式定义在 components 目录下的各个组件 CSS 文件中
 */

.container-custom{
    max-width: 140rem;
    margin: auto;
}

.site-section{
    align-items: center;
    display: flex;
    flex-direction: column;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.site-container {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    margin-left: auto;
    margin-right: auto;
    max-width: 140rem;
}

/* 当 site-container 和 site-header__top-inner 同时使用时，使用 row 布局 */
.site-container.site-header__top-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* 导航栏样式 */
.navbar {
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-image {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Section Title */
.section-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Service Cards */
.service-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.service-icon {
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Portfolio Cards */
.portfolio-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2) !important;
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.portfolio-placeholder {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-card:hover .portfolio-placeholder {
    transform: scale(1.1);
}

/* Contact Form */
.contact-info {
    padding: 2rem;
    transition: transform 0.3s ease;
}

.contact-info:hover {
    transform: translateY(-5px);
}

#contactForm .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

#contactForm .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.back-to-top.show {
    display: flex;
}

/* Bricks Button - Global Styles */
.bricks-button {
    padding-top: var(--space-xs);
    padding-right: var(--space-m);
    padding-bottom: var(--space-xs);
    padding-left: var(--space-m);
    font-size: var(--text-s);
    font-weight: 600;
    transition: all .2s ease;
}

/* Product Detail Page - Default Font Size */
body.product-detail,
.product-detail body {
    font-size: var(--default-font-size, var(--text-m));
}

body.about-us,
.about-us body {
    font-size: var(--default-font-size, var(--text-m));
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Card Hover Effects */
.card {
    transition: all 0.3s ease;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* 手机端统一边距（导航与所有块离屏幕左右的距离） */
    :root {
        --mobile-edge: 1rem;
    }

    /* 手机端整页与所有块不超出屏幕，禁止左右滑动 */
    html {
        max-width: 100vw;
        overflow-x: hidden;
    }
    body {
        max-width: 100vw;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* 所有块/区块统一左边距、右边距（仅最外层 section，内层容器不再叠加） */
    .site-section {
        padding-left: var(--mobile-edge) !important;
        padding-right: var(--mobile-edge) !important;
    }
    /* 无 section 包裹时，容器也使用统一边距 */
    body > .container-custom,
    body > .site-container {
        padding-left: var(--mobile-edge) !important;
        padding-right: var(--mobile-edge) !important;
    }

    /* 所有块级容器不超屏，并裁剪溢出 */
    body * {
        box-sizing: border-box;
    }
    div, section, article, main, aside, header, footer, nav,
    .site-section, .site-container, .container-custom, .site-div,
    [class*="__inner"], [class*="container"], [class*="wrapper"],
    .row, .container {
        max-width: 100% !important;
    }
    /* 每个 section 在手机端裁剪溢出，防止内部模块撑出屏幕 */
    .site-section {
        overflow-x: hidden !important;
        min-width: 0;
    }
    .site-container,
    .container-custom {
        overflow-x: hidden !important;
        min-width: 0;
    }

    /* 首页 Hero 全宽列表：取消负边距和超 100% 宽度，避免横向溢出 */
    .Hhero__list,
    .Hhero__list.site-block {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* 轮播/列表等模块不超出容器 */
    .Mslide .splide__list,
    .Mslide__container,
    .splide__track,
    .Mtab__inner,
    .Mabout__inner,
    .MForm__inner,
    .card-Mreviews,
    .Mfaq__accordion {
        max-width: 100% !important;
        min-width: 0;
    }

    img, svg {
        max-width: 100% !important;
        height: auto;
    }
    video, iframe, embed, object {
        max-width: 100% !important;
    }
    table {
        max-width: 100% !important;
        overflow-x: auto;
        display: block;
    }

    .section-title {
        font-size: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animation */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

