/*!
 * 精怡科技 - 官网样式
 * 科技蓝主题
 */

:root {
    --primary: #0066cc;
    --primary-dark: #004c99;
    --primary-light: #3399ff;
    --primary-bg: #f0f6ff;
}

body {
    font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    scroll-behavior: auto; /* 由 JS 控制平滑滚动 */
}

/* ========== 导航栏 ========== */
.navbar-brand span {
    font-family: "Microsoft YaHei", sans-serif;
    letter-spacing: 2px;
}

#mainNav {
    transition: background-color 0.3s, box-shadow 0.3s;
}

#mainNav .nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s;
}

#mainNav .nav-link:hover,
#mainNav .nav-link.active {
    color: var(--primary) !important;
}

/* ========== Hero 视频背景 ========== */
.hero-section {
    position: relative;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 1;
    object-fit: cover;
}

/* 移动端降级：不播视频，用静态底图代替 */
@media (max-width: 768px) {
    .hero-section {
        min-height: 500px;
        background-image: url('../images/banner-bg.jpg');
        background-size: cover;
        background-position: center;
    }
    .hero-video {
        display: none;
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 60, 130, 0.75) 0%, rgba(0, 102, 204, 0.55) 100%);
    z-index: 3;
}

.hero-content {
    position: relative;
    z-index: 4;
    height: 100%;
}

/* ========== 通用按钮 ========== */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    transition: background-color 0.2s, border-color 0.2s;
}

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

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

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

/* ========== 板块通用 ========== */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* ========== 服务 / 产品卡片 ========== */
.service-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 102, 204, 0.15) !important;
}

.service-card .card-body {
    padding: 2rem 1.5rem;
}

.service-icon {
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 28px;
    margin: 0 auto 1.2rem;
    transition: background 0.3s, color 0.3s;
}

.service-card:hover .service-icon {
    background: var(--primary);
    color: #fff;
}

/* ========== 关于我们 ========== */
#about {
    background: #f8f9fa;
}

.about-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.about-image-wrapper img {
    transition: transform 0.5s;
}

.about-image-wrapper:hover img {
    transform: scale(1.05);
}

.about-text h3 {
    color: var(--primary);
}

/* ========== 数据统计 ========== */
#stats {
    background: linear-gradient(135deg, #004c99 0%, #0066cc 100%) !important;
}

.stat-item h2 {
    font-weight: 800;
}

/* ========== 产品展示 ========== */
#cases {
    background: #fff;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}

.portfolio-item img {
    transition: transform 0.5s;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 9:16 产品图容器 */
.product-img-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%; /* 16/9 ≈ 177.78%，实现 9:16 比例 */
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.product-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.portfolio-item:hover img {
    transform: scale(1.08);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 60, 130, 0.8);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

/* ========== 资质证书 ========== */
#team {
    background: #f8f9fa;
}

.team-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.team-card img {
    width: 100%;
    height: 260px;
    object-fit: cover;
}

/* ========== 新闻动态 ========== */
.news-card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

.news-card img {
    height: 200px;
    object-fit: cover;
}

.news-date {
    color: var(--primary);
    font-size: 0.85rem;
}

/* ========== 联系我们 ========== */
#contact {
    background: #fff;
}

.contact-info h4 {
    color: var(--primary);
}

.contact-info .fa {
    color: var(--primary) !important;
}

.map-container {
    border-radius: 8px;
}

/* ========== 返回顶部 ========== */
.btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: none;
    z-index: 999;
    font-size: 18px;
    line-height: 45px;
    text-align: center;
    padding: 0;
}

.btn-back-to-top.show {
    display: block;
}

/* ========== Footer ========== */
footer a:hover {
    color: var(--primary-light) !important;
    text-decoration: none;
}

/* ========== 响应式微调 ========== */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.2rem;
    }
}
