/* ============================================
   动画交互系统 v2 - 鸿康造纸机械
   34个交互效果
   ============================================ */

/* ========== Keyframes ========== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(20, 41, 135, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(20, 41, 135, 0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes slideInFill {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideInFromBottom {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(4); opacity: 0; }
}

@keyframes bounceArrow {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-12px); }
    60% { transform: translateY(-6px); }
}

@keyframes rotateIn {
    from { opacity: 0; transform: rotate(-10deg) scale(0.8); }
    to { opacity: 1; transform: rotate(0) scale(1); }
}

@keyframes progressGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes heroTextReveal {
    from { opacity: 0; transform: translateY(35px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes heroSlideInRight {
    from { opacity: 0; transform: translateX(80px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scrollProgress {
    from { width: 0%; }
    to { width: 100%; }
}

@keyframes dividerExpand {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes badgePop {
    0% { transform: scale(0.8); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes underlineExpand {
    from { width: 0; }
    to { width: 100%; }
}

/* ========== Common Utility Classes ========== */

.anim-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.anim-reveal.anim-visible {
    opacity: 1;
    transform: translateY(0);
}

.anim-reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.anim-reveal-left.anim-visible {
    opacity: 1;
    transform: translateX(0);
}

.anim-reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.anim-reveal-right.anim-visible {
    opacity: 1;
    transform: translateX(0);
}

.anim-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.anim-scale.anim-visible {
    opacity: 1;
    transform: scale(1);
}

.anim-delay-1 { transition-delay: 0.1s !important; }
.anim-delay-2 { transition-delay: 0.2s !important; }
.anim-delay-3 { transition-delay: 0.3s !important; }
.anim-delay-4 { transition-delay: 0.4s !important; }
.anim-delay-5 { transition-delay: 0.5s !important; }
.anim-delay-6 { transition-delay: 0.6s !important; }
.anim-delay-7 { transition-delay: 0.7s !important; }
.anim-delay-8 { transition-delay: 0.8s !important; }

img.anim-lazy-fade {
    opacity: 0;
    transition: opacity 0.6s ease;
}
img.anim-lazy-fade.anim-loaded {
    opacity: 1;
}

/* ========== Hero Section Effects ========== */

/* Text word-by-word entrance */
.hero-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(35px);
    filter: blur(4px);
    animation: heroTextReveal 0.6s ease forwards;
}

.hero-word-line {
    display: block;
    margin-bottom: 4px;
}

.hero-p-sub {
    display: block;
    opacity: 0;
    animation: slideUpFade 0.6s ease forwards;
    animation-delay: 1s;
}

.hero-p-sub span {
    display: inline-block;
    opacity: 0;
    animation: heroTextReveal 0.5s ease forwards;
}

/* Product image entrance + floating */
.hero-img-animate {
    opacity: 0;
    animation: heroSlideInRight 1s ease forwards;
    animation-delay: 0.4s;
}
.hero-img-animate.anim-float {
    animation: floating 3.5s ease-in-out infinite;
    opacity: 1;
}

/* Mouse spotlight */
.hero-spotlight {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.hero:hover .hero-spotlight {
    opacity: 1;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 5;
    opacity: 0;
    animation: fadeInDown 1s ease 1.5s forwards;
}
.scroll-indicator-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid rgba(255,255,255,0.6);
    border-bottom: 2px solid rgba(255,255,255,0.6);
    transform: rotate(45deg);
    animation: bounceArrow 2s infinite;
}

/* Magnetic button */
.btn-magnetic {
    position: relative;
    display: inline-block;
    transition: transform 0.2s ease;
}

/* ========== Navigation Effects ========== */

.scrolled-nav {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important;
}

.nav-links a.active::after {
    width: 100% !important;
}

.logo a {
    display: block;
    transition: transform 0.3s ease;
}
.logo a:hover {
    transform: rotate(-3deg);
}

/* ========== Scroll Progress Bar ========== */

.scroll-progress-bar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 10000;
    overflow: hidden;
}

.scroll-progress-bar::after {
    content: '';
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #142987), var(--accent, #3B82F6));
    transition: width 0.1s linear;
}

/* ========== Section Divider Animation ========== */

.section-divider {
    border: none;
    height: 1px;
    background: #ddd;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.8s ease;
    margin-bottom: 40px;
}
.section-divider.anim-visible {
    transform: scaleX(1);
}

/* ========== English Title ========== */

.anim-en-title {
    /* glow effect removed */
}

/* ========== 3D Tilt Cards (Products) ========== */

.tilt-card {
    transform-style: preserve-3d;
    perspective: 800px;
}

.tilt-card .card-inner {
    transition: transform 0.15s ease;
    transform-style: preserve-3d;
}

.tilt-card .card-shine {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 3;
    border-radius: inherit;
}

.tilt-card:hover .card-shine {
    opacity: 1;
}

/* ===== Card bottom color bar */
.card-color-bar {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary, #142987), var(--accent, #3B82F6));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: 5;
}
.tilt-card:hover .card-color-bar {
    transform: scaleX(1);
}

/* ===== Image cursor tracking */
.cursor-track-img {
    transition: transform 0.2s ease;
    transform-origin: center center;
}

/* ========== Product Overlay Enhancement ========== */

.product-item {
    position: relative;
    border-radius: 4px;
}
.product-item .product-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(20, 41, 135, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 2;
    border-radius: 4px;
}
.product-item:hover .product-overlay {
    opacity: 1;
}
.product-overlay span {
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid rgba(255,255,255,0.6);
    padding: 8px 20px;
    transition: all 0.3s;
}
.product-item:hover .product-overlay span {
    border-color: #fff;
}

/* ========== "View All" Button ========== */

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: var(--primary, #142987);
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    position: relative;
    overflow: hidden;
}
.view-all-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--primary-light, #1e3bb5);
    transform: translateY(100%);
    transition: transform 0.4s ease;
    z-index: 0;
}
.view-all-btn:hover::before {
    transform: translateY(0);
}
.view-all-btn span {
    position: relative;
    z-index: 1;
}
.view-all-btn .view-all-arrow {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}
.view-all-btn:hover .view-all-arrow {
    transform: translateX(6px);
}

.view-all-wrapper {
    text-align: center;
    margin-top: 40px;
}

/* ========== Counter Animation ========== */

.counter-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 50px 0;
}
.counter-item {
    text-align: center;
}
.counter-number {
    font-family: 'Oswald', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 8px;
}
.counter-label {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}

/* ========== About Card 3D Flip ========== */

.about-card-3d {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
}
.about-card-3d:hover {
    transform: perspective(800px) rotateY(5deg) translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.about-card-3d .about-card-img img {
    transition: transform 0.4s ease;
}
.about-card-3d:hover .about-card-img img {
    transform: scale(1.08);
}

/* ========== News Featured Image Hover ========== */

.news-featured-img {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}
.news-featured-img::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(20, 41, 135, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.news-featured-img:hover::after {
    opacity: 1;
}
.news-featured-img img {
    transition: transform 0.4s ease;
}
.news-featured-img:hover img {
    transform: scale(1.05);
}

/* ===== News date badge */
.news-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--primary, #142987);
    color: #fff;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    padding: 4px 10px;
    z-index: 2;
    opacity: 0;
    animation: badgePop 0.3s ease 0.2s forwards;
}

/* ===== News card bottom bar */
.news-card {
    position: relative;
    overflow: hidden;
}
.news-card .card-color-bar {
    bottom: 0;
}

/* ========== Arrow Slide Effect ========== */

.arrow-slide {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.arrow-slide .arrow-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}
.arrow-slide:hover .arrow-icon {
    transform: translateX(6px);
}

/* ========== Case Image Hover Overlay ========== */

.case-item {
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.case-img-hover {
    position: relative;
    overflow: hidden;
}
.case-img-hover img {
    transition: transform 0.4s ease;
}
.case-item:hover .case-img-hover img {
    transform: scale(1.05);
}

/* ===== Case card gradient border */
.case-gradient-border {
    position: relative;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}
.case-gradient-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, var(--primary, #142987), var(--accent, #3B82F6));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}
.case-gradient-border:hover {
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.case-gradient-border:hover::before {
    opacity: 1;
}

/* ========== Form Floating Labels ========== */

.form-floating {
    position: relative;
}
.form-floating label {
    position: absolute;
    left: 16px;
    top: 12px;
    color: #999;
    font-size: 14px;
    transition: all 0.3s ease;
    pointer-events: none;
    background: transparent;
    padding: 0 4px;
}
.form-floating input:focus + label,
.form-floating input:not(:placeholder-shown) + label,
.form-floating textarea:focus + label,
.form-floating textarea:not(:placeholder-shown) + label {
    top: -10px;
    font-size: 12px;
    color: var(--primary, #142987);
    background: #fff;
}
.form-floating input,
.form-floating textarea {
    position: relative;
    z-index: 1;
}

/* ===== Input underline animation ===== */
.form-underline {
    position: relative;
}
.form-underline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary, #142987);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.form-underline:focus-within::after {
    transform: scaleX(1);
}

/* ===== Validation shake ===== */
.form-shake {
    animation: shake 0.5s ease;
}

/* ===== Ripple effect ===== */
.ripple-container {
    position: relative;
    overflow: hidden;
}
.ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    animation: ripple 0.6s ease-out forwards;
    pointer-events: none;
}

/* ========== Submit Button States ========== */

.submit-btn {
    position: relative;
    overflow: hidden;
}
.submit-btn .btn-text {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.submit-btn .btn-loader {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}
.submit-btn .btn-success {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}
.submit-btn.loading .btn-text { opacity: 0; transform: translateY(10px); }
.submit-btn.loading .btn-loader { display: block; }
.submit-btn.success .btn-text { opacity: 0; transform: translateY(10px); }
.submit-btn.success .btn-success { display: block; }

/* ========== Footer Link Hover ========== */

.footer-col a {
    transition: all 0.3s ease !important;
}
.footer-col a:hover {
    transform: translateX(-4px);
}

/* ========== Social Icon Hover ========== */

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    transition: all 0.3s ease;
}
.footer-social a:hover {
    transform: translateY(-4px) rotate(360deg);
}

/* ========== Back to Top Enhanced ========== */

.back-to-top {
    position: fixed;
    bottom: 40px; right: 40px;
    width: 46px; height: 46px;
    background: var(--primary, #142987);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.35s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(20, 41, 135, 0.3);
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--primary-light, #1e3bb5);
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(20, 41, 135, 0.45);
}
.back-to-top .btt-icon {
    transition: transform 0.3s ease;
}
.back-to-top:hover .btt-icon {
    transform: rotate(360deg);
}

/* ========== Page Load Fade ========== */

body.anim-page-load {
    opacity: 0;
    transition: opacity 0.6s ease;
}
body.anim-page-loaded {
    opacity: 1;
}

/* ========== Section Title Underline ========== */

.anim-title-line {
    position: relative;
    display: inline-block;
}
.anim-title-line::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary, #142987);
    transition: width 0.8s ease;
}
.anim-title-line.anim-visible::after {
    width: 60px;
}

/* ========== Case Button Slide Fill ========== */

.case-more-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.case-more-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--primary-light, #1e3bb5);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
    z-index: -1;
}
.case-more-btn:hover::before {
    transform: translateX(0);
}

/* ========== Form Focus Enhancements ========== */

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary, #142987) !important;
    box-shadow: 0 0 0 3px rgba(20, 41, 135, 0.1);
}

/* ========== Reduced Motion ========== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .anim-reveal, .anim-reveal-left, .anim-reveal-right, .anim-scale {
        opacity: 1 !important;
        transform: none !important;
    }
    .hero-word, .hero-p-sub, .hero-p-sub span,
    .hero-img-animate, .scroll-indicator {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        animation: none !important;
    }
}

/* ========== Mobile Responsive ========== */

@media (max-width: 768px) {
    .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; font-size: 18px; }
    .scroll-indicator { display: none; }
    .counter-section { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .counter-number { font-size: 32px; }
    .view-all-btn { padding: 12px 24px; font-size: 14px; }
}
