/* 兆友电器网站 - 主样式表 */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    color: #333; background: #fff; line-height: 1.6;
}
a { color: #333; text-decoration: none; transition: color .2s; }
a:hover { color: #1a6fc4; }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }

/* === Layout === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* === Header === */
.site-header {
    background: #fff; border-bottom: 3px solid #1a6fc4;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.header-top {
    padding: 15px 0; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo img { height: 50px; }
.logo h1 { font-size: 22px; color: #1a6fc4; font-weight: 700; }
.header-links { display: flex; gap: 15px; font-size: 12px; }
.header-links a { color: #666; }
.header-search { display: flex; align-items: center; }
.header-search input {
    border: 1px solid #ddd; border-radius: 3px 0 0 3px;
    padding: 5px 10px; font-size: 12px; width: 160px; outline: none;
}
.header-search button {
    background: #1a6fc4; color: #fff; border: none; padding: 5px 12px;
    border-radius: 0 3px 3px 0; cursor: pointer; font-size: 12px;
}

/* === Navigation === */
.main-nav { background: #1a6fc4; }
.main-nav ul { display: flex; }
.main-nav li { position: relative; }
.main-nav li a {
    display: block; color: #fff; padding: 12px 30px; font-size: 15px;
    transition: background .2s;
}
.main-nav li a:hover, .main-nav li.active a { background: rgba(0,0,0,.15); }
.main-nav .dropdown { position: absolute; top: 100%; left: 0; z-index: 100;
    background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.15); display: none; min-width: 160px;
}
.main-nav li:hover .dropdown { display: block; }
.main-nav .dropdown a { color: #333; padding: 10px 20px; font-size: 13px; }
.main-nav .dropdown a:hover { background: #f0f7ff; color: #1a6fc4; }

/* === Banner === */
.banner { position: relative; overflow: hidden; background: #eef5fc; }
.banner-slides { position: relative; height: 380px; }
.banner-slides img {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 1200px; height: 380px; object-fit: cover; opacity: 0; transition: opacity .8s;
}
.banner-slides img.active { opacity: 1; }
.banner-dots {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 10;
}
.banner-dots span {
    width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.5);
    cursor: pointer; transition: background .3s;
}
.banner-dots span.active { background: #fff; }

/* === Section Headers === */
.section-header {
    display: flex; align-items: center; padding: 20px 0 15px; border-bottom: 2px solid #1a6fc4;
    margin-bottom: 20px;
}
.section-header h2 { font-size: 20px; color: #1a6fc4; }
.section-header .more {
    margin-left: auto; color: #999; font-size: 13px;
}

/* === Index Sections === */
.home-middle {
    display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 25px; padding: 25px 0;
}
.home-about { padding: 15px; }
.home-about .pic { float: left; margin-right: 15px; margin-bottom: 10px; }
.home-about .pic img { border-radius: 4px; }
.home-about .desc { font-size: 13px; line-height: 24px; color: #555; }
.home-news { padding: 15px; }
.news-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #ddd; }
.news-item:last-child { border-bottom: none; }
.news-item .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-item .date { color: #999; font-size: 12px; margin-left: 10px; flex-shrink: 0; }
.home-cert { padding: 15px; }
.home-cert img { border-radius: 4px; }

.product-grid-section { padding: 25px 0; }
.product-group {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.product-group a { display: block; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.08); transition: transform .2s, box-shadow .2s; }
.product-group a:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.product-group img { width: 100%; height: 180px; object-fit: cover; }

/* === Content Page Layout === */
.content-page { display: flex; gap: 25px; padding: 25px 0; }
.content-main { flex: 1; min-width: 0; }
.content-sidebar { width: 260px; flex-shrink: 0; }
.sidebar-block { border: 1px solid #e8e8e8; border-radius: 4px; margin-bottom: 20px; overflow: hidden; }
.sidebar-title { background: #1a6fc4; color: #fff; padding: 12px 15px; font-size: 15px; }
.sidebar-body { padding: 15px; }
.sidebar-contact li { padding: 8px 0; font-size: 13px; border-bottom: 1px dashed #eee; }
.sidebar-contact li:last-child { border-bottom: none; }
.sidebar-contact .label { color: #1a6fc4; font-weight: 600; margin-right: 5px; }

/* === Breadcrumb === */
.breadcrumb { padding: 12px 0; font-size: 13px; color: #999; }
.breadcrumb a { color: #666; }
.breadcrumb a:hover { color: #1a6fc4; }

/* === Product List === */
.product-list-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.product-card {
    border: 1px solid #eee; border-radius: 4px; overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-2px); }
.product-card .thumb { width: 100%; height: 170px; object-fit: contain; background: #fff; }
.product-card .name {
    padding: 10px; text-align: center; font-size: 13px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* === Product Detail === */
.product-detail { padding: 20px 0; }
.product-images { float: left; width: 350px; margin-right: 25px; }
.product-images .main-img { border: 1px solid #eee; border-radius: 4px; }
.product-info h1 { font-size: 22px; margin-bottom: 15px; }
.product-info .meta { color: #999; font-size: 13px; margin-bottom: 15px; }
.product-content { clear: both; padding-top: 20px; border-top: 1px solid #eee; margin-top: 20px; }

/* === News List === */
.news-list .item { padding: 15px 0; border-bottom: 1px dashed #ddd; }
.news-list .item h3 { font-size: 15px; margin-bottom: 5px; }
.news-list .item h3 a:hover { color: #1a6fc4; }
.news-list .item .date { font-size: 12px; color: #999; }

/* === News Detail === */
.news-detail h1 { font-size: 22px; text-align: center; margin-bottom: 10px; }
.news-detail .meta { text-align: center; color: #999; font-size: 13px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.news-detail .content { line-height: 1.8; }

/* === Certificate Gallery === */
.cert-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.cert-card { border: 1px solid #eee; border-radius: 4px; overflow: hidden; cursor: pointer; transition: box-shadow .2s; }
.cert-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.cert-card img { width: 100%; height: 200px; object-fit: cover; }

/* Lightbox */
.lightbox {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.9); z-index: 1000; justify-content: center; align-items: center;
    flex-direction: column;
}
.lightbox.active { display: flex; }
.lightbox-content {
    display: flex; flex-direction: column; align-items: center; max-width: 90%; max-height: 85%;
}
.lightbox img { max-width: 90vw; max-height: 75vh; border-radius: 4px; object-fit: contain; }
.lightbox-title {
    color: #fff; font-size: 16px; margin-top: 15px; text-align: center;
    max-width: 600px; word-break: break-all;
}
.lightbox .close {
    position: absolute; top: 15px; right: 25px; color: #fff; font-size: 42px;
    cursor: pointer; width: 48px; height: 48px; line-height: 48px; text-align: center;
    background: rgba(255,255,255,.15); border-radius: 50%; transition: background .2s;
    z-index: 1001;
}
.lightbox .close:hover { background: rgba(255,255,255,.3); }

/* === Performance Table === */
.performance-table { width: 100%; border-collapse: collapse; }
.performance-table th { background: #1a6fc4; color: #fff; padding: 10px; font-weight: 500; }
.performance-table td { padding: 10px; border-bottom: 1px solid #eee; text-align: center; }
.performance-table tr:hover td { background: #f0f7ff; }

/* === Recruitment === */
.recruit-list .item { border: 1px solid #eee; border-radius: 4px; margin-bottom: 15px; }
.recruit-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; background: #f8f8f8; cursor: pointer;
}
.recruit-header h3 { font-size: 16px; }
.recruit-meta { display: flex; gap: 20px; font-size: 13px; color: #666; }
.recruit-body { padding: 15px 20px; display: none; }
.recruit-list .item.open .recruit-body { display: block; }
.recruit-list .item.open .recruit-header { background: #e8f0fe; }

/* === Contact === */
.contact-content { margin-bottom: 25px; }
.map-container { border-radius: 6px; overflow: hidden; border: 1px solid #eee; }
#mapContainer { width: 100%; height: 400px; }

/* === Message Form === */
.message-form { max-width: 600px; }
.message-form .form-group { margin-bottom: 15px; }
.message-form label { display: block; font-weight: 600; margin-bottom: 5px; }
.message-form input, .message-form textarea, .message-form select {
    width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px;
    font-size: 14px;
}
.message-form textarea { height: 120px; resize: vertical; }
.message-form .btn {
    background: #1a6fc4; color: #fff; border: none; padding: 10px 30px;
    border-radius: 4px; cursor: pointer; font-size: 15px; transition: background .2s;
}
.message-form .btn:hover { background: #155a9e; }

/* === Pagination === */
.pagination {
    display: flex; justify-content: center; gap: 5px; padding: 25px 0;
}
.pagination a, .pagination span {
    display: inline-block; padding: 6px 12px; border: 1px solid #ddd;
    border-radius: 3px; font-size: 13px; transition: all .2s;
}
.pagination a:hover { border-color: #1a6fc4; color: #1a6fc4; }
.pagination .active { background: #1a6fc4; color: #fff; border-color: #1a6fc4; }
.pagination .disabled { color: #ccc; cursor: not-allowed; }

/* === Footer === */
.site-footer {
    background: #1a6fc4; color: #fff; text-align: center; padding: 18px;
    font-size: 13px; margin-top: 30px;
}
.site-footer a { color: #cce3ff; }

/* === QQ Float === */
.qq-float {
    position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 999;
}
.qq-toggle {
    display: block; width: 28px; height: 80px; background: #1a6fc4; color: #fff;
    writing-mode: vertical-rl; text-align: center; font-size: 12px; cursor: pointer;
    border-radius: 4px 0 0 4px; line-height: 28px;
}
.qq-panel {
    display: none; position: absolute; right: 28px; top: 0; width: 150px;
    background: #fff; border: 1px solid #1a6fc4; border-radius: 4px; padding: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.qq-float.open .qq-panel { display: block; }
.qq-panel h4 { font-size: 13px; color: #1a6fc4; margin-bottom: 8px; }
.qq-panel li { padding: 5px 0; font-size: 12px; }
.qq-panel li img { vertical-align: middle; }

/* === Flash Messages === */
.flash-messages { padding: 10px 0; }
.flash-msg {
    padding: 10px 15px; border-radius: 4px; margin-bottom: 8px; font-size: 14px;
}
.flash-msg.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-msg.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* === Responsive === */
/* Tablet */
@media (max-width: 1024px) {
    .home-middle { grid-template-columns: 1fr; gap: 15px; }
    .product-group { grid-template-columns: repeat(2, 1fr); }
    .header-search input { width: 120px; }
}

/* Mobile */
@media (max-width: 768px) {
    .container { padding: 0 12px; }

    /* Header */
    .header-top { padding: 10px 0; flex-direction: column; gap: 10px; }
    .logo h1 { font-size: 18px; }
    .header-links { font-size: 11px; gap: 8px; }
    .header-search { display: none; }

    /* Navigation - hamburger style */
    .main-nav .container { padding: 0; }
    .main-nav ul {
        flex-wrap: wrap; justify-content: center;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    .main-nav li a { padding: 8px 12px; font-size: 12px; }
    .main-nav .dropdown { position: static; box-shadow: none; min-width: 100%; }
    .main-nav li:hover .dropdown { display: none; }

    /* Banner */
    .banner-slides { height: 200px; }
    .banner-slides img { width: 100%; height: 200px; object-fit: cover; }
    .banner-dots { bottom: 8px; }
    .banner-dots span { width: 8px; height: 8px; }

    /* Home sections */
    .home-middle { grid-template-columns: 1fr; gap: 15px; padding: 15px 0; }
    .home-about, .home-news, .home-cert { padding: 10px; }
    .home-about .desc { font-size: 12px; line-height: 22px; }
    .section-header { padding: 12px 0 10px; margin-bottom: 12px; }
    .section-header h2 { font-size: 16px; }

    /* Products */
    .product-group, .product-list-grid, .cert-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-group img { height: 130px; }
    .product-card .thumb { height: 120px; }

    /* Product detail */
    .product-images { float: none; width: 100%; margin-right: 0; margin-bottom: 15px; }
    .product-info h1 { font-size: 18px; }

    /* Content pages */
    .content-page { flex-direction: column; }
    .content-sidebar { width: 100%; }
    .content-body { padding: 10px 0 !important; }
    .content-body p { font-size: 14px; }

    /* Certificates gallery */
    .cert-gallery { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }

    /* News list */
    .news-item { padding: 6px 0; }
    .news-item .title { font-size: 12px; }
    .news-item .date { font-size: 11px; }

    /* Footer */
    .site-footer { padding: 12px; font-size: 11px; line-height: 1.5; }

    /* Lightbox */
    .lightbox img { max-width: 95vw; max-height: 70vh; }
    .lightbox .close { top: 10px; right: 15px; font-size: 36px; width: 40px; height: 40px; line-height: 40px; }
    .lightbox-title { font-size: 13px; padding: 0 15px; }

    /* QQ float - hide on mobile */
    .qq-float { display: none; }

    /* Forms */
    .message-form input, .message-form textarea { font-size: 16px; }

    /* Pagination */
    .pagination a, .pagination span { padding: 5px 8px; font-size: 12px; }

    /* Breadcrumb */
    .breadcrumb { font-size: 12px; padding: 8px 0; }
}

/* Small mobile */
@media (max-width: 480px) {
    .container { padding: 0 8px; }
    .logo h1 { font-size: 16px; }
    .main-nav li a { padding: 6px 8px; font-size: 11px; }
    .banner-slides { height: 160px; }
    .banner-slides img { height: 160px; }
    .product-group, .product-list-grid, .cert-grid, .cert-gallery { grid-template-columns: 1fr !important; }
    .product-group img { height: 110px; }
    .section-header h2 { font-size: 15px; }
}
