/*
Theme Name: 上海攸晖科技
Theme URI: https://www.youhui-tech.com
Author: Youhui Tech
Description: 叽咕叽咕，叽咕咕咕叽咕，咕叽咕叽~
Version: 1.10
License: GNU General Public License v2 or later
Text Domain: youhui

Tags: one-column, custom-logo, responsive-layout, light, white, blue
*/

/* ========== 全局基础 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #fff;
    color: #333;
    line-height: 1.8;
    padding-top: 77px; /* 为固定头部预留空间 */
}

h1, h2, h3 {
    font-weight: 500;
    letter-spacing: -0.5px;
}

p {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 16px;
}

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

section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 60px;
    color: #222;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #0070c0;
    margin: 15px auto;
}

ul.points {
    list-style: none;
    font-size: 1.1em;
    color: #555;
}

ul.points li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 25px;
}

ul.points li::before {
    content: "●";
    color: #0070c0;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #0070c0;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #005ea6;
    transform: translateY(-2px);
}

/* ========== 头部导航 ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    transition: background 0.4s ease-in-out, padding 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.site-branding h1 {
    font-size: 1.6em;
    margin: 0;
}

.site-branding a {
    color: #0070c0;
    text-decoration: none;
    font-weight: bold;
}

.main-navigation {
    line-height: 1;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 8px 12px;
    color: #0070c0;
    text-decoration: none;
    font-size: 1.05em;
    border-radius: 6px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #0070c0;
    z-index: -1;
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 6px;
}

.nav-menu a:hover::before {
    left: 0;
}

.nav-menu a:hover {
    color: white;
    transform: translateY(-2px);
}

/* ========== 轮播图 ========== */
.slider {
    position: relative;
    width: 100%;
    height: 1000px;
    overflow: hidden;
    border-radius: 8px;
    /* 删除原来的 margin */
    /* margin: 70px auto 0; ← 删除这行 */
    margin: 0 auto; /* ← 改为 0，完全由 body padding-top 控制位置 */
    cursor: grab;
}

.slider:active {
    cursor: grabbing;
}

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

.slide.active {
    opacity: 1;
    z-index: 1;
}

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

.slide-content {
    position: absolute;
    top: 50%;
    left: 5%;
    transform: translateY(-50%);
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.slide-content h2 {
    font-size: 2.5em;
    margin: 0 0 10px;
}

.slide-content p {
    font-size: 1.4em;
    margin: 15px 0;
    color: #ffffff; /* 副标题白色 */
    opacity: 0.95;
}

.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #000;
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-size: 1.2em;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
}

.slider-prev {
    left: 20px;
}

.slider-next {
    right: 20px;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background: #0070c0;
}

.slider-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    z-index: 10;
}

/* ========== 卡片与内容区块 ========== */
.feature-grid,
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card,
.news-card {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.card:hover,
.news-card:hover {
    transform: translateY(-5px);
}

.card h3,
.news-card h3 {
    font-size: 1.5em;
    color: #0070c0;
    margin-bottom: 15px;
}

/* 新闻卡片特殊样式 */
.news-card {
    background: white;
    padding: 20px;
}

.news-image {
    height: 200px;
    display: flex;
    justify-content: center;   /* 水平居中 */
    align-items: center;       /* 垂直居中 */
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 16px;
    background-color: #f5f5f5; /* 可选：给无图时加浅灰底 */
    color: #999;
    font-size: 14px;
}
    
    
.news-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-image img,
.image-placeholder {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.image-placeholder {
    background: #eef5ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1.1em;
}

.logo-placeholder {
    height: 60px;
    background: #ddd;
    width: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* ========== 时间轴（修复版） ========== */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 40px auto;
    overflow: visible; /* ← 关键：改为 visible，避免裁剪圆点 */
    padding: 0 20px;   /* ← 可选：增加左右内边距，防止极端情况下仍被裁 */
}

.timeline::before {
    content: '';
    position: absolute;
    width: 2px;
    background: #ddd;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
}

.timeline-item {
    width: 50%;
    position: relative;
    margin-bottom: 30px;
    clear: both;
    z-index: 1;
}

.timeline-item:nth-child(odd) {
    float: left;
    padding-right: 60px; /* ← 增加右侧空间，避免文字贴线 */
    text-align: right;
}

.timeline-item:nth-child(even) {
    float: right;
    padding-left: 60px;  /* ← 增加左侧空间 */
    text-align: left;
}

.timeline-content {
    background: #f3f8ff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    max-width: 380px;
    position: relative;
}

/* 圆点样式 */
.timeline-content::after {
    content: '';
    position: absolute;
    width: 12px;        /* ← 稍微加大更清晰 */
    height: 12px;
    background: #0070c0;
    border-radius: 50%;
    top: 15px;          /* ← 微调垂直位置 */
    z-index: 2;
}

.timeline-item:nth-child(even) .timeline-content::after {
    right: -6px;        /* ← 与 padding-left:60px 配合，确保圆点在线上 */
}

.timeline-item:nth-child(odd) .timeline-content::after {
    left: -6px;         /* ← 同上 */
}

.timeline-date {
    color: #0070c0;
    font-weight: bold;
    margin-bottom: 8px;
}

/* 清除浮动（保险起见） */
.timeline::after {
    content: "";
    display: table;
    clear: both;
}

/* ========== 页脚 ========== */
footer {
    text-align: center;
    padding: 60px 0;
    background: #f0f0f0;
    color: #666;
}

/* ========== 响应式适配 ========== */
@media (max-width: 768px) {
    .site-header {
        padding: 15px 20px;
    }

    .nav-menu {
        gap: 10px;
    }

    .feature-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .slider {
        height: 600px;
    }

    .slide img {
        height: 600px;
    }

    .slide-content h2 {
        font-size: 1.8em;
    }

    .slide-content p {
        font-size: 1.1em;
    }

    /* 简化时间轴为单列 */
    .timeline::before {
        left: 30px;
    }

    .timeline-item,
    .timeline-item:nth-child(even),
    .timeline-item:nth-child(odd) {
        width: 100%;
        float: none;
        padding-left: 70px !important;
        padding-right: 0 !important;
        text-align: left;
    }

    .timeline-content::after {
        left: 15px !important;
        right: auto !important;
    }
}

@media (min-width: 1366px) {
    .slider {
        height: 750px;
    }

    .slide img {
        height: 750px;
    }
}

/* ========== 产品服务新样式（含完整淡入淡出） ========== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 50px;
    padding: 0 20px;
}

.product-card {
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 112, 192, 0.25);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    transition: opacity 0.4s ease;
    z-index: 1;
}
/* 悬停时遮罩变浅（图片变亮） */
.product-card:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

.product-card h3 {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1.25em;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    z-index: 2;
    margin: 0;
    padding: 0 10px;
}

/* ✅ 关键：伪元素 ::after 必须在常态定义 transition */
.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-image: var(--hover-img); /* 提前加载 hover 图 */
    opacity: 0;
    transition: opacity 0.5s ease; /* ✅ 淡入淡出都靠它 */
    z-index: 0;
}

.product-card:hover::after {
    opacity: 1;
}

/* ========== 合作伙伴新样式 ========== */
.partner-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 手机默认 2 列 */
    gap: 30px;
    margin-top: 40px;
    justify-items: center;
}

/* 平板 */
@media (min-width: 768px) {
    .partner-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 桌面 */
@media (min-width: 992px) {
    .partner-grid {
        grid-template-columns: repeat(5, 1fr); /* 强制 5 列 */
    }
}

.partner-item {
    width: 100%;
    max-width: 180px; /* 控制最大宽度 */
    aspect-ratio: 2 / 1; /* 固定宽高比（如 2:1），可按需调整 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden; /* 防止图片溢出 */
}



.partner-item:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.partner-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 保持比例，完整显示 */
    /* 或用 object-fit: cover + border-radius，但可能裁剪 */
    transition: filter 0.3s ease;
}

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

/* 让页脚中的链接看起来像普通文字 */
footer a {
    color: inherit;           /* 继承父元素（<p> 或 footer）的文字颜色 */
    text-decoration: none;    /* 去掉下划线 */
}