/* ============================================
   华北康港钢构有限公司官网 - 主样式表
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #666666;
    background-color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: #C41E24;
}

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

ul {
    list-style: none;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: #C41E24;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #A01820;
    color: #ffffff;
}

.btn-secondary {
    background-color: transparent;
    color: #C41E24;
    border: 1px solid #C41E24;
}

.btn-secondary:hover {
    background-color: #C41E24;
    color: #ffffff;
}

/* 头部导航 */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-bar {
    background-color: #C41E24;
    padding: 8px 0;
}

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

.header-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-bar-left a,
.header-bar-left span {
    color: #ffffff;
    font-size: 13px;
    text-decoration: none;
}

.header-bar-left a:hover {
    color: #ffd0d0;
}

.header-bar-search {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    height: 32px;
    margin: 0;
    padding: 0;
}

.header-bar-search input {
    border: none;
    outline: none;
    padding: 0 15px;
    font-size: 13px;
    width: 180px;
    height: 100%;
    color: #333;
}

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

.header-bar-search button {
    background: #C41E24;
    border: none;
    color: #ffffff;
    width: 36px;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0 18px 18px 0;
}

.header-bar-search button svg {
    width: 16px;
    height: 16px;
    stroke: #ffffff;
}

.header-main {
    background-color: #ffffff;
    border-bottom: 1px solid #E5E5E5;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    position: relative;
}

.header-top .logo {
    flex-shrink: 0;
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #2C2C2C;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #2C2C2C;
}

.main-nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-nav > ul > li {
    position: relative;
    display: flex;
    align-items: center;
}

.main-nav > ul > li:not(:last-child)::after {
    content: '|';
    color: #cccccc;
    font-size: 14px;
    margin: 0 20px;
    line-height: 1;
    display: inline-block;
}

.main-nav > ul > li > a {
    display: inline-block;
    padding: 28px 0;
    font-size: 16px;
    font-weight: 500;
    color: #2C2C2C;
    position: relative;
    line-height: 1;
}

.main-nav > ul > li.active > a,
.main-nav > ul > li > a:hover {
    color: #C41E24;
}

.main-nav > ul > li.active > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #C41E24;
}

/* 下拉菜单 */
.main-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background-color: #ffffff;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.main-nav .dropdown-menu li {
    display: block;
    width: 100%;
    flex: none;
}

.main-nav .dropdown-menu li a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    color: #666666;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    white-space: nowrap;
}

.main-nav .dropdown-menu li:last-child a {
    border-bottom: none;
}

.main-nav .dropdown-menu li a:hover {
    background-color: #f5f5f5;
    color: #C41E24;
}

/* Banner 轮播 */
.banner {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.banner-slider {
    position: relative;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.banner-slide.active {
    opacity: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 20px;
}

.banner-content-inner {
    max-width: 500px;
}

.banner-content h2 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
}

.banner-content p {
    font-size: 20px;
    margin-bottom: 30px;
}

.banner-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: #ffffff;
}

.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.banner-arrow:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.banner-arrow.prev {
    left: 30px;
}

.banner-arrow.next {
    right: 30px;
}

/* 通用区块 */
.section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 15px;
    border-bottom: 1px solid #E5E5E5;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #2C2C2C;
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background-color: #C41E24;
}

.more-link {
    font-size: 14px;
    color: #C41E24;
    font-weight: 500;
}

.more-link:hover {
    text-decoration: underline;
}

/* 公司简介 */
.section-intro {
    background-color: #f9f9f9;
}

.intro-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.intro-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 4px;
}

.intro-text p {
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: #666666;
}

.intro-text .btn {
    margin-top: 10px;
}

/* 产品中心 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background-color: #ffffff;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2C2C2C;
    margin-bottom: 8px;
}

.product-info p {
    font-size: 13px;
    color: #999999;
}

/* 产品中心轮播 */
.products-carousel-wrapper {
    position: relative;
    padding: 0 50px;
}

.products-carousel {
    overflow: hidden;
    border-radius: 4px;
}

.products-carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    gap: 20px;
}

.products-carousel-track .product-card {
    flex: 0 0 calc((100% - 60px) / 4);
    min-width: 0;
}

.products-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: #ffffff;
    border: 1px solid #E5E5E5;
    border-radius: 50%;
    color: #2C2C2C;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.products-carousel-arrow:hover {
    background-color: #C41E24;
    color: #ffffff;
    border-color: #C41E24;
}

.products-carousel-arrow.prev {
    left: 0;
}

.products-carousel-arrow.next {
    right: 0;
}

.products-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.products-carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #cccccc;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.products-carousel-dots .dot.active {
    background-color: #C41E24;
}

/* 工程案例 */
.section-cases {
    background-color: #f9f9f9;
}

.cases-slider {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.case-card {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.case-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.case-card:hover img {
    transform: scale(1.05);
}

.case-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #ffffff;
}

.case-info h4 {
    font-size: 16px;
    font-weight: 600;
}

/* 新闻资讯 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.news-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.news-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.news-date .day {
    font-size: 24px;
    font-weight: 700;
    color: #C41E24;
}

.news-date .month {
    font-size: 12px;
    color: #999999;
}

.news-content {
    flex: 1;
}

.news-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: #2C2C2C;
    margin-bottom: 8px;
}

.news-content h4 a:hover {
    color: #C41E24;
}

.news-content p {
    font-size: 13px;
    color: #999999;
    line-height: 1.6;
}

/* 合作伙伴 */
.section-partners {
    background-color: #f9f9f9;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    align-items: center;
}

.partner-item {
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    transition: all 0.3s ease;
}

.partner-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.partner-item img {
    max-height: 40px;
    width: auto;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.partner-item:hover img {
    filter: grayscale(0%);
}

/* 页脚 */
.footer {
    background-color: #C41E24;
    color: #ffffff;
    padding: 20px 0;
}

.footer-content {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.footer-content p {
    font-size: 14px;
    margin: 0;
    display: inline;
}

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

.footer-content a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 1199px) {
    .products-carousel-track .product-card {
        flex: 0 0 calc((100% - 40px) / 3);
    }
    .cases-slider {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .partners-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 991px) {
    .header-bar-left {
        gap: 5px;
    }

    .header-bar-left a,
    .header-bar-left span {
        font-size: 12px;
    }

    .header-bar-search input {
        width: 120px;
    }

    .header-top {
        height: 60px;
        padding: 0;
    }

    .hamburger-btn {
        display: flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background-color: #ffffff;
        border-bottom: 1px solid #E5E5E5;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
    }

    .main-nav > ul > li {
        border-bottom: 1px solid #f0f0f0;
    }

    .main-nav > ul > li:last-child {
        border-bottom: none;
    }

    .main-nav > ul > li:not(:last-child)::after {
        display: none;
    }

    .main-nav > ul > li > a {
        padding: 14px 0;
        font-size: 15px;
    }

    .main-nav > ul > li.active > a::after {
        display: none;
    }

    .main-nav > ul > li.active > a {
        color: #C41E24;
    }

    .main-nav .dropdown > a {
        position: relative;
    }

    .main-nav .dropdown > a::before {
        content: '';
        position: absolute;
        right: 20px;
        top: 50%;
        width: 8px;
        height: 8px;
        border-right: 2px solid #999;
        border-bottom: 2px solid #999;
        transform: translateY(-50%) rotate(45deg);
        transition: transform 0.3s ease;
    }

    .main-nav .dropdown.active > a::before {
        transform: translateY(-50%) rotate(-135deg);
    }
    
    .banner {
        height: 400px;
    }
    
    .banner-content {
        left: 50%;
        max-width: 400px;
        transform: translate(-50%, -50%);
    }
    
    .banner-content h2 {
        font-size: 36px;
    }
    
    .intro-content {
        grid-template-columns: 1fr;
    }
    
    .products-carousel-track .product-card {
        flex: 0 0 calc((100% - 20px) / 2);
    }
    .cases-slider {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .main-nav .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        background-color: #f9f9f9 !important;
        display: none !important;
        flex-direction: column !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        list-style: none;
    }

    .main-nav .dropdown.active > .dropdown-menu {
        display: block !important;
    }

    .main-nav .dropdown-menu li a {
        padding: 12px 35px !important;
        font-size: 14px;
        color: #666666;
        border-bottom: 1px solid #f0f0f0;
        display: block;
    }

    .main-nav .dropdown-menu li:last-child a {
        border-bottom: none;
    }
}

@media (max-width: 767px) {
    .logo img {
        height: 36px;
    }

    .header-top {
        height: 55px;
    }

    .main-nav {
        top: 55px;
        max-height: calc(100vh - 55px);
    }

    .main-nav > ul > li > a {
        font-size: 14px;
        padding: 12px 20px;
    }

    .main-nav .dropdown-menu li a {
        padding: 10px 35px !important;
        font-size: 13px;
    }

    .banner {
        height: 200px;
    }

    .banner-content {
        left: 50%;
        max-width: 90%;
        padding: 0 15px;
        transform: translate(-50%, -50%);
    }

    .banner-content-inner {
        max-width: 100%;
    }

    .banner-content h2 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .banner-content p {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .banner-arrow {
        display: none;
    }

    .banner-dots {
        bottom: 12px;
    }

    .dot {
        width: 8px;
        height: 8px;
    }

    .btn {
        padding: 8px 20px;
        font-size: 13px;
    }

    .container {
        padding: 0 15px;
    }

    .section {
        padding: 30px 0;
    }

    .section-header {
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    .section-title {
        font-size: 18px;
        padding-left: 12px;
    }

    .section-title::before {
        height: 18px;
    }

    .more-link {
        font-size: 12px;
    }

    .intro-content {
        gap: 20px;
    }

    .intro-image img {
        height: 200px;
    }

    .intro-text p {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .products-carousel-wrapper {
        padding: 0 35px;
    }
    .products-carousel-track .product-card {
        flex: 0 0 100%;
    }
    .products-carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .cases-slider {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .product-image {
        height: 180px;
    }

    .product-info {
        padding: 15px;
    }

    .product-info h3 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .product-info p {
        font-size: 12px;
    }

    .case-card img {
        height: 200px;
    }

    .case-info {
        padding: 15px;
    }

    .case-info h4 {
        font-size: 14px;
    }

    .news-list {
        gap: 15px;
    }

    .news-item {
        padding: 15px;
        gap: 12px;
    }

    .news-date {
        min-width: 55px;
        padding: 8px 6px;
    }

    .news-date .day {
        font-size: 20px;
    }

    .news-date .month {
        font-size: 11px;
    }

    .news-content h4 {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .news-content p {
        font-size: 12px;
    }

    .partners-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .partner-item {
        height: 60px;
        padding: 10px;
    }

    .partner-item img {
        max-height: 30px;
    }

    .footer {
        padding: 20px 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .footer-content p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .banner {
        height: 170px;
    }

    .banner-content h2 {
        font-size: 18px;
    }

    .banner-content p {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .main-nav ul {
        gap: 6px;
    }

    .main-nav > ul > li > a {
        font-size: 13px;
    }

    .section-title {
        font-size: 17px;
    }

    .intro-image img {
        height: 170px;
    }

    .news-item {
        flex-direction: column;
        align-items: stretch;
    }

    .news-date {
        flex-direction: row;
        gap: 8px;
        min-width: auto;
        justify-content: flex-start;
    }
}
