/**
 * 东安检测官网主样式文件
 * 使用CSS变量实现快速主题切换
 */

/* ========================
   CSS变量定义
   ======================== */
:root {
    /* 主色调 - 在header.php中动态设置 */
    --primary-color: #1e5eff;
    --primary-dark: #44518e;
    --primary-light: #4d7fff;
    --primary-bg: #f0f5ff;
    
    /* 辅助色 */
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --info-color: #1890ff;
    
    /* 中性色 */
    --text-primary: #333333;
    --text-regular: #666666;
    --text-secondary: #999999;
    --text-light: #cccccc;
    --border-color: #e8e8e8;
    --bg-color: #f5f7fa;
    --bg-light: #fafafa;
    --white: #ffffff;
    --black: #000000;
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-sm: 12px;
    
    /* 圆角 */
    --border-radius: 4px;
    --border-radius-lg: 8px;
    --border-radius-sm: 2px;
    
    /* 阴影 */
    --box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --box-shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --box-shadow-sm: 0 1px 4px rgba(0,0,0,0.05);
    
    /* 过渡 */
    --transition: all 0.3s ease;
    --transition-fast: all 0.2s ease;
}

/* ========================
   基础样式重置
   ======================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

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

/* ========================
   工具类
   ======================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-padding {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-center {
    text-align: center;
}

/* ========================
   按钮样式
   ======================== */
.btn {
    display: inline-block;
    padding: 10px 30px;
    font-size: var(--font-size-base);
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary {
    color: var(--white);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    background-color: transparent;
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    color: var(--white);
    background-color: var(--primary-color);
}

.btn-white {
    color: var(--primary-color);
    background-color: var(--white);
    border-color: var(--white);
}

.btn-outline-white {
    color: var(--white);
    background-color: transparent;
    border-color: var(--white);
}

/* ========================
   顶部信息栏
   ======================== */
.top-bar {
    background-color: var(--bg-color);
    padding: 10px 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.top-info span {
    margin-right: 20px;
}

.top-info i {
    color: var(--primary-color);
    margin-right: 5px;
}

.top-social a {
    color: var(--text-secondary);
    margin-left: 15px;
    font-size: 16px;
}

.top-social a:hover {
    color: var(--primary-color);
}

/* ========================
   导航栏
   ======================== */
.navbar {
    background-color: var(--white);
    box-shadow: var(--box-shadow-sm);
    padding: 15px 0;
    transition: var(--transition);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.navbar-brand {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-brand img {
    height: 40px;
    width: auto;
}

.navbar-menu {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .navbar-menu {
        display: none !important;
    }
    
    .navbar-menu.active {
        display: block !important;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .navbar-menu ul {
        flex-direction: column !important;
    }
    
    .navbar-menu .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }
    
    .navbar-menu .nav-link {
        display: block !important;
        padding: 15px 20px !important;
    }
}

.navbar-menu ul {
    display: flex;
    flex-wrap: nowrap;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.navbar-menu .nav-item {
    position: relative;
    white-space: nowrap;
}

.navbar-menu .nav-link {
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-weight: 500;
    padding: 10px 20px;
    display: block;
    text-decoration: none;
    position: relative;
    transition: var(--transition);
}

.navbar-menu .nav-link:hover,
.navbar-menu .nav-item.active .nav-link {
    color: var(--primary-color);
}

.navbar-menu .nav-item.active .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    min-width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* 移动端菜单按钮（默认隐藏） */
.mobile-menu-toggle {
    display: none;
}

/* 移动端遮罩层（默认隐藏） */
.mobile-menu-overlay {
    display: none;
}

/* ========================
   轮播图
   ======================== */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-slide {
    height: 500px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
}

.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 移除背景遮罩，让图片显示原色 */
    /* background: rgba(0,0,0,0.4); */
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--white);
}

.hero-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    animation-delay: 0.2s;
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 30px;
    animation-delay: 0.4s;
}

.hero-content .btn {
    animation-delay: 0.6s;
}

/* 隐藏轮播图切换按钮 */
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
    display: none !important;
}

/* ========================
   章节标题
   ======================== */
.section-title {
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 36px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.title-line {
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 20px 0;
}

.section-title .subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-top: 15px;
}

/* ========================
   服务卡片
   ======================== */
.service-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.service-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.service-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.service-link {
    color: var(--primary-color);
    font-weight: 500;
}

/* ========================
   新闻卡片
   ======================== */
.news-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.news-image {
    height: 200px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.news-content {
    padding: 20px;
}

.news-date {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: 10px;
}

.news-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.news-title a {
    color: var(--text-primary);
    font-weight: bold;
}

.news-summary {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.read-more {
    color: var(--primary-color);
    font-weight: 500;
}

/* ========================
   资质证书卡片
   ======================== */
.certificate-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.certificate-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.certificate-card {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    height: 100%;
}

.certificate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.certificate-card img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.cert-title {
    font-size: 14px;
    color: var(--text-primary);
    margin: 10px 0 0;
}

/* ========================
   页面横幅
   ======================== */
.page-banner {
    background: var(--primary-color) !important;
    padding: 100px 0 60px;
    color: white;
    text-align: center;
}

.page-banner .page-title,
.page-banner h1 {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    color: white;
}

.page-banner p {
    font-size: 20px;
    opacity: 0.9;
    color: white;
}

.page-banner .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.page-banner .breadcrumb-item {
    color: rgba(255,255,255,0.8);
}

.page-banner .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.6);
}

.page-banner .breadcrumb-item a {
    color: rgba(255,255,255,0.9);
}

.page-banner .breadcrumb-item.active {
    color: white;
}

/* ========================
   资质证书
   ======================== */
.certificate-card {
    text-align: center;
    padding: 20px;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.certificate-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.certificate-card img {
    height: 150px;
    object-fit: contain;
    margin-bottom: 15px;
}

.cert-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
}

/* ========================
   联系CTA
   ======================== */
.contact-cta {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 60px 0;
}

.contact-cta h3 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
}

.contact-cta p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
}

/* ========================
   页脚
   ======================== */
.site-footer {
    background-color: #2c3e50;
    color: var(--white);
    padding-top: 60px;
}

.footer-widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--white);
}

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

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

.footer-links a {
    color: rgba(255,255,255,0.7);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.contact-info li:last-child {
    margin-bottom: 0;
}

.contact-info i,
.contact-info li > span:first-child,
.contact-info li > svg:first-child {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    margin-right: 10px;
    display: inline-block;
}



.contact-info a {
    color: rgba(255,255,255,0.7);
}

.contact-info a:hover {
    color: var(--white);
}

.social-links {
    margin-top: 20px;
}

.social-link {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    margin-right: 10px;
    color: var(--white);
    font-size: 18px;
}

.social-link:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.footer-bottom {
    background-color: #1a252f;
    padding: 20px 0;
    margin-top: 40px;
}

.copyright {
    margin: 0;
    color: rgba(255,255,255,0.7);
}

.copyright a {
    color: rgba(255,255,255,0.7);
}

.footer-links-bottom a {
    color: rgba(255,255,255,0.7);
    margin: 0 10px;
}

/* ========================
   在线客服
   ======================== */
.online-service {
    position: fixed;
    right: 20px;
    bottom: 120px;
    z-index: 998;
}

.service-btn {
    display: block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    margin-bottom: 10px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
}

.service-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.1);
    color: var(--white);
}

/* 微信二维码弹窗 */
.wechat-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.wechat-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.wechat-modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 20px;
}

.wechat-modal-close:hover {
    color: #000;
}

.wechat-modal-content h3 {
    margin: 0 0 20px;
    color: var(--text-primary);
}

.wechat-qrcode-box {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.wechat-qrcode-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wechat-modal-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========================
   响应式设计
   ======================== */
@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .section-title h2 {
        font-size: 28px;
    }
    
    .contact-cta h3 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .navbar-brand .logo {
        height: 30px;
    }
    
    .top-bar {
        display: none;
    }
}
