/* SCIV 首页样式（由 index.html 内联样式拆分而来）
 * 注意：修改本文件后，需同步把 index.html 里 VERSION 中 'css/home.css' 的版本号 +1，
 * 否则老访客会一直读取 localStorage 里的旧缓存。
 */

/* 引入自定义字体 */
@font-face {
    font-family: 'SCIVLogoFont';
    src: url('../pic/logo.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.sciv-logo-text {
    font-family: 'SCIVLogoFont', 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 1.2em;
    letter-spacing: 0.1em;
    background: linear-gradient(60deg, #818cf8, #0aa5f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    left: 6px;
    top: 2.3px;
}

/* PC端（屏幕宽度>768px） */
@media (min-width: 769px) {
    .sciv-logo-text {
        top: 3.2px;
    }
    .header-banner {
        position: absolute;
        right: 10vw;
        height: 8.8em;
        width: auto;
        z-index: 10;
    }
}

/* 移动端隐藏banner */
@media (max-width: 768px) {
    .header-banner {
        display: none;
    }
}

/* 页面加载动画 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

        /* 页面加载动画（绿色转圈） */
        .loader-spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid rgba(79, 192, 141, 0.8);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
        sans-serif;
    font-size: calc(10px + 0.33vw);
    -webkit-font-smoothing: antialiased;
    padding: 5vh 10vw;
    color: #121314;
    margin-bottom: 5vh;
    overflow-x: hidden;
    margin: 0;
    padding-top: calc(5vh - 50px) !important;
    /* 为底部信息区域预留空间 */
    position: relative;
    padding-bottom: 80px;
    /* 平滑滚动 */
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    body {
        padding-top: 5vh !important;
        padding-bottom: 100px;
        /* 移除移动端字体优化 */
    }
}

h1 {
    font-size: 4.3em;
    font-weight: 500;
    margin-bottom: 0;
    /* 标题渐入动画 */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.3s;
}

p {
    font-size: 1.6em;
    font-weight: 300;
    line-height: 1.36;
    max-width: 28em;
    /* 段落渐入动画 */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.5s;
}

/* 渐入动画 */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-link {
    text-decoration: none;
    color: #121314;
    position: relative;
    cursor: pointer; /* 添加鼠标指针样式 */
    /* 点击反馈 */
    transition: color 0.2s ease;
}

.content-link:after {
    content: '';
    position: absolute;
    z-index: -1;
    top: 60%;
    left: -0.1em;
    right: -0.1em;
    bottom: 0;
    transition: top 200ms cubic-bezier(0, 0.8, 0.13, 1);
    background-color: rgba(79, 192, 141, 0.5);
}

.content-link:hover:after {
    top: 0%;
}

/* 点击效果 */
.content-link:active {
    color: #2c7a54;
}

.product-logos {
    width: 100%;
    padding: 2vh 0;
    /* logo区域渐入 */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.7s;
}

.scroll-row {
    width: 100%;
    overflow: hidden;
    position: relative;
    margin-bottom: 2vh;
    will-change: transform;
}

.scroll-row:last-child {
    margin-bottom: 0;
}

.scroll-container {
    display: flex;
    gap: 1.5vw;
    animation: scroll 60s linear infinite;
    width: max-content;
}

.scroll-container.reverse {
    animation-name: scroll-reverse;
}

/* 仅在PC端（屏幕宽度>768px）保留鼠标悬停暂停动画 */
@media (min-width: 769px) {
    .scroll-row:hover .scroll-container {
        animation-play-state: paused;
    }
}

.logo-item:hover img {
    transform: scale(1.05);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-50% - 0.75vw));
    }
}

@keyframes scroll-reverse {
    0% {
        transform: translateX(calc(-50% - 0.75vw));
    }
    100% {
        transform: translateX(0);
    }
}

.logo-item {
    aspect-ratio: 353 / 200;
    width: clamp(50px, 10vw, 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 0em;
    transition: all 0.3s ease;
    overflow: hidden;
}

.logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s ease, opacity 0.5s ease;
    border-radius: inherit;
    opacity: 0;
}

/* 图片加载完成后显示 */
.logo-item img.loaded {
    opacity: 1;
}

@media (max-width: 768px) {
    .scroll-container {
        gap: 2vw;
        animation-duration: 70s;
        /* 降低移动端动画速度，给图片加载留时间 */
        animation-duration: 80s;
    }
    .logo-item {
        width: clamp(80px, 20vw, 150px);
        border-radius: 8px;
        padding: 0em;
    }
    @keyframes scroll {
        0% { transform: translateX(0); }
        100% { transform: translateX(calc(-50% - 1vw)); }
    }
    @keyframes scroll-reverse {
        0% { transform: translateX(calc(-50% - 1vw)); }
        100% { transform: translateX(0); }
    }

    /* 移动端强制关闭所有暂停效果 */
    .scroll-row .scroll-container {
        animation-play-state: running !important;
    }
}

.footer-info {
    position: absolute;
    bottom: 3vh;
    left: 10vw;
    right: 10vw;
    font-size: 1.2em;
    display: flex;
    justify-content: space-between; /* 两端对齐：版权左，备案号右 */
    align-items: center;
    /* 底部信息渐入 */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.9s;
}

/* 版权和备案号纵向排列，版权在上 */
@media (max-width: 768px) {
    .footer-info {
        flex-direction: column;
        align-items: flex-start; /* 手机端保持靠左 */
        gap: 0.5em;
    }
}

.copyright {
    text-decoration: none;
    color: #121314;
    display: inline-block;
}

.icp-info {
    text-decoration: none;
    color: #121314;
    position: relative;
    display: inline-block;
    transition: color 0.2s ease;
}

.icp-info:after {
    content: '';
    position: absolute;
    z-index: -1;
    top: 60%;
    left: -0.1em;
    right: -0.1em;
    bottom: 0;
    transition: top 200ms cubic-bezier(0, 0.8, 0.13, 1);
    background-color: rgba(79, 192, 141, 0.5);
}

.icp-info:hover:after {
    top: 0%;
}

/* 备案号点击效果 */
.icp-info:active {
    color: #2c7a54;
}

.index_title {
    background: url(../pic/0.webp) no-repeat center bottom;
    background-size: 100% auto;
    background-position: center;
    padding: 0.2em 0.5em;
    display: inline-block;
    background-clip: padding-box;
    font-size: inherit;
}

/* 复制提示框样式 */
.copy-tooltip {
    position: fixed;
    background: #121314;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    top: 20px;
    right: 20px;
}

/* 图片加载错误样式 */
.logo-item img.error {
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.8em;
}

.logo-item img.error:before {
    content: '图片加载失败';
}
