/* ========================================
   荣科铭峰 - 精密工业网站建设
   全局样式文件
   ======================================== */

/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #f5f7fa;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 颜色变量 */
:root {
    --primary-dark: #0a192f;
    --primary-medium: #1a3a5c;
    --primary-light: #2d5a7a;
    --accent-blue: #3b82f6;
    --text-dark: #1a1a1a;
    --text-gray: #666;
    --text-light: #999;
    --bg-white: #ffffff;
    --bg-light: #f5f7fa;
    --bg-gray: #e8ecf1;
}

/* ========================================
   导航栏样式
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 25, 47, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header.scrolled {
    background: rgba(10, 25, 47, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-text {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo-text span {
    color: var(--accent-blue);
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.15);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 60%;
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 移动端菜单 */
@media (max-width: 1024px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--primary-dark);
        flex-direction: column;
        padding: 40px 20px;
        gap: 4px;
        transition: left 0.4s ease;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu a {
        padding: 18px 24px;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hamburger {
        display: flex;
    }

    .nav-container {
        padding: 0 20px;
    }
}

/* ========================================
   页脚样式
   ======================================== */
.footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
    color: #fff;
    padding: 80px 0 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 60px;
    margin-bottom: 60px;
}

.footer-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #fff;
    position: relative;
    padding-bottom: 12px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-blue);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 16px;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-blue);
    padding-left: 8px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.7);
}

.footer-contact li i {
    color: var(--accent-blue);
    margin-top: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--accent-blue);
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ========================================
   通用组件样式
   ======================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent-blue));
    border-radius: 2px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-gray);
    margin-top: 24px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--primary-dark);
    border: 2px solid var(--primary-dark);
}

.btn-outline:hover {
    background: var(--primary-dark);
    color: #fff;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.card-content {
    padding: 28px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.card-text {
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 20px;
}

/* 动画效果 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 网格布局 */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 32px;
    }

    .container {
        padding: 0 20px;
    }
}

/* ========================================
   横幅样式
   ======================================== */
.banner {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--primary-dark);
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

.banner-slide.active {
    opacity: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4);
}

.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    max-width: 900px;
    padding: 0 20px;
}

.banner-title {
    font-size: 64px;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.2;
    animation: slideUp 1s ease forwards;
    opacity: 0;
}

.banner-subtitle {
    font-size: 24px;
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
    animation: slideUp 1s ease 0.3s forwards;
    opacity: 0;
}

.banner-btn {
    animation: slideUp 1s ease 0.6s forwards;
    opacity: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .banner-title {
        font-size: 40px;
    }

    .banner-subtitle {
        font-size: 18px;
    }
}

/* ========================================
   内页头部样式
   ======================================== */
.page-header {
    position: relative;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-medium));
    margin-top: 80px;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/bg-pattern.png') repeat;
    opacity: 0.05;
}

.page-header-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
}

.page-header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
}

.page-header p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb a:hover {
    color: var(--accent-blue);
}

.breadcrumb span {
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .page-header {
        margin-top: 60px;
    }

    .page-header h1 {
        font-size: 36px;
    }
}
