/* 伟力稷官网 · 全站视觉与交互动效 */

/* 导航链接不换行（不影响品牌 Logo） */
.nav-links a,
#mobileMenu a {
    white-space: nowrap;
}

@media (min-width: 1280px) {
    nav h1 {
        white-space: nowrap;
    }
}

/* 手机端比例优化 */
@media (max-width: 767px) {
    nav h1 {
        font-size: 0.9rem !important;
        line-height: 1.3;
    }
    nav h1 + p {
        font-size: 0.6rem !important;
    }
    nav .w-12.h-12 {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    nav > .container > a,
    nav > .container > div:first-child {
        min-width: 0;
    }
    nav > .container > div:last-child {
        flex-shrink: 0;
    }
    nav #mobileMenuBtn {
        width: 2.5rem;
        height: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    section.py-16 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    section.py-14 {
        padding-top: 2.25rem !important;
        padding-bottom: 2.25rem !important;
    }
    .text-3xl {
        font-size: 1.6rem !important;
        line-height: 2.1rem !important;
    }
    .text-4xl {
        font-size: 1.9rem !important;
        line-height: 2.3rem !important;
    }
    body > div.bg-primary.text-white {
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
        font-size: 0.7rem !important;
    }
    body > div.bg-primary.text-white p {
        line-height: 1.4;
    }
    .hero-cta a {
        width: 100%;
        text-align: center;
    }
    .quote-animation p {
        font-size: 1.05rem !important;
        line-height: 1.7 !important;
    }
    .tagline-animation {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
    }
}

/* 锚点跳转时避开吸顶导航 */
section[id],
article[id],
div[id] {
    scroll-margin-top: 96px;
}

/* 顶部阅读进度条 */
#scrollProgress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #2E7D32, #81C784, #F57C00);
    z-index: 9999;
    transition: width 0.08s linear;
    box-shadow: 0 0 8px rgba(46, 125, 50, 0.5);
}

/* 返回顶部 */
#backToTop {
    position: fixed;
    right: 24px;
    bottom: 28px;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.9);
    transition: all 0.3s ease;
    z-index: 9998;
    box-shadow: 0 12px 30px -8px rgba(27, 94, 32, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.25);
}
#backToTop.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
#backToTop:hover {
    background: linear-gradient(135deg, #F57C00, #E65100);
    transform: translateY(-3px);
}

/* 滚动入场 */
.reveal-init {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.75s cubic-bezier(0.2, 0.65, 0.3, 1);
    will-change: opacity, transform;
}
.reveal-init.revealed {
    opacity: 1;
    transform: none;
}

/* 导航滚动状态 */
nav.nav-scrolled {
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.18);
}

/* 首屏缓慢推近 */
.kenburns {
    animation: kenburns 20s ease-in-out infinite alternate;
}
@keyframes kenburns {
    from { transform: scale(1) translate(0, 0); }
    to { transform: scale(1.08) translate(-1%, -1%); }
}

/* 漂浮光斑 */
.blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(60px);
    opacity: 0.35;
    animation: blobFloat 14s ease-in-out infinite;
    pointer-events: none;
}
.blob-delay {
    animation-delay: -6s;
}
@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(24px, -20px) scale(1.08); }
    66% { transform: translate(-18px, 16px) scale(0.94); }
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(90deg, #2E7D32 0%, #66BB6A 55%, #81C784 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 卡片高光扫过 */
.shine {
    position: relative;
    overflow: hidden;
}
.shine::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -70%;
    width: 38%;
    height: 220%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: rotate(22deg);
    transition: left 0.7s ease;
    pointer-events: none;
}
.shine:hover::after {
    left: 135%;
}

/* 公告滚动跑马灯 */
.ticker-mask {
    overflow: hidden;
}
.ticker-track {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: ticker 32s linear infinite;
}
.ticker-mask:hover .ticker-track {
    animation-play-state: paused;
}
@keyframes ticker {
    to { transform: translateX(-50%); }
}

/* Toast */
#toastWrap {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: min(92vw, 420px);
}
.toast-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 9999px;
    background: rgba(27, 94, 32, 0.96);
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s cubic-bezier(0.2, 0.7, 0.3, 1.2);
    backdrop-filter: blur(8px);
}
.toast-item.toast-warn {
    background: rgba(230, 81, 0, 0.97);
}
.toast-item.toast-out {
    animation: toastOut 0.3s ease forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateY(10px) scale(0.97); }
}

/* 图片灯箱 */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(8px);
}
#lightbox.open {
    display: flex;
    animation: toastIn 0.25s ease;
}
#lightbox img {
    max-width: 92vw;
    max-height: 86vh;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
#lightbox .lb-close {
    position: absolute;
    top: 22px;
    right: 26px;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}
#lightbox .lb-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    text-align: center;
}

/* 点击涟漪 */
.ripple-ink {
    position: absolute;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.45);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

/* 图片通用 hover 缩放 */
.img-zoom img {
    transition: transform 0.7s cubic-bezier(0.2, 0.65, 0.3, 1);
}
.img-zoom:hover img {
    transform: scale(1.06);
}

/* 手风琴 */
details.faq summary::-webkit-details-marker {
    display: none;
}
details.faq[open] .fa-plus {
    transform: rotate(45deg);
}
details.faq .fa-plus {
    transition: transform 0.25s ease;
}

/* 表单控件 */
.form-input {
    width: 100%;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus {
    outline: none;
    border-color: #2E7D32;
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.12);
}

/* 直播扫描线 */
.scanlines::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px);
    pointer-events: none;
    z-index: 2;
}
.scan-beam {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(129, 199, 132, 0.8), transparent);
    animation: scanBeam 4.5s linear infinite;
    z-index: 2;
    pointer-events: none;
}
@keyframes scanBeam {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* 数字滚动 */
.counter {
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .reveal-init {
        opacity: 1;
        transform: none;
    }
}
