/* Custom Styles for 信易签 */

/* Reset and prevent horizontal scroll */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* 为固定导航栏留出空间 */
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #F59E0B;
    outline-offset: 2px;
}

/* Navigation Link Styles */
a.nav-link,
.nav-link {
    position: relative;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: 0 !important;
    outline-width: 0 !important;
    outline-style: none !important;
    box-shadow: none !important;
    border: none !important;
}

a.nav-link:focus,
a.nav-link:focus-visible,
a.nav-link:active,
.nav-link:focus,
.nav-link:focus-visible,
.nav-link:active {
    outline: 0 !important;
    outline-width: 0 !important;
    outline-style: none !important;
    box-shadow: none !important;
    border: none !important;
}

a.nav-link.active,
.nav-link.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(139, 92, 246, 0.1));
    color: #F59E0B !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3), 
                inset 0 0 10px rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

a.nav-link:hover:not(.active),
.nav-link:hover:not(.active) {
    background: rgba(245, 158, 11, 0.08);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15) !important;
    border: none !important;
}

/* Remove all possible focus rings */
a.nav-link:focus-visible,
.nav-link:focus-visible {
    outline: 0 !important;
    outline-offset: 0 !important;
    outline-width: 0 !important;
    box-shadow: none !important;
    border: none !important;
}

a.nav-link.active:focus,
a.nav-link.active:focus-visible,
.nav-link.active:focus,
.nav-link.active:focus-visible {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3), 
                inset 0 0 10px rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Gradient Animation */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
}

/* Particles Background */
#particles-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    left: 0;
    top: 0;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(245, 158, 11, 0.3);
    border-radius: 50%;
    animation: float linear infinite;
    will-change: transform;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Navbar Scroll Effect */
.navbar-scrolled {
    background: rgba(15, 23, 42, 0.95) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
}

/* Counter Animation */
.counter {
    display: inline-block;
}

/* Product Tab Active State */
.product-tab.active {
    background: linear-gradient(to right, #F59E0B, #FBBF24);
    color: #0F172A;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.2);
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #F59E0B;
    outline-offset: 2px;
}

/* Back to Top Button */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top:hover {
    transform: scale(1.1) translateY(-2px);
}

#back-to-top:active {
    transform: scale(0.95);
}

/* Scroll Direction Animations */
/* 初始状态：元素默认隐藏（除了首屏的 Hero Section） */
section:not(.animated-once):not(:first-of-type),
.product-content:not(.animated-once),
.group:not(.animated-once) {
    opacity: 0;
}

/* 首屏 Hero Section 始终可见 */
section:first-of-type {
    opacity: 1 !important;
}

/* 往下滚动：从下方淡入上移 */
.scroll-in-down {
    animation: slideInFromBottom 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 往上滚动：从上方淡入下移 */
.scroll-in-up {
    animation: slideInFromTop 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 从下方滑入动画 */
@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translateY(60px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 从上方滑入动画 */
@keyframes slideInFromTop {
    0% {
        opacity: 0;
        transform: translateY(-60px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* 禁用滚动动画 */
    .scroll-in-down,
    .scroll-in-up {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* 确保所有元素可见 */
    section,
    .product-content,
    .group {
        opacity: 1 !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0F172A;
}

::-webkit-scrollbar-thumb {
    background: #F59E0B;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #FBBF24;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #F59E0B;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Button Hover States */
button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    nav,
    footer,
    button {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}


/* Decorative Stickers and Elements */

/* Floating decorative icons */
.decorative-icon {
    position: absolute;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.decorative-icon.animate {
    animation: float-slow 20s ease-in-out infinite;
}

@keyframes float-slow {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(-10px) rotate(-5deg);
    }
    75% {
        transform: translateY(-30px) rotate(3deg);
    }
}

/* Geometric shapes */
.geometric-shape {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.shape-circle {
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(139, 92, 246, 0.1));
}

.shape-square {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(245, 158, 11, 0.08));
    transform: rotate(45deg);
}

.shape-triangle {
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 86px solid rgba(245, 158, 11, 0.08);
}

/* Gradient blobs */
.gradient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    animation: blob-float 15s ease-in-out infinite;
}

@keyframes blob-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.gradient-blob-1 {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2), transparent);
}

.gradient-blob-2 {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2), transparent);
}

.gradient-blob-3 {
    background: radial-gradient(circle, rgba(251, 191, 36, 0.15), transparent);
}

/* Sticker badges */
.sticker-badge {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    animation: sticker-pulse 3s ease-in-out infinite;
}

@keyframes sticker-pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
}

/* Dotted pattern */
.dot-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(245, 158, 11, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
}

/* Line pattern */
.line-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(245, 158, 11, 0.03) 10px,
        rgba(245, 158, 11, 0.03) 20px
    );
    pointer-events: none;
    z-index: 0;
}

/* Sparkle effect */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #F59E0B;
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle-twinkle 2s ease-in-out infinite;
}

@keyframes sparkle-twinkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Decorative corner elements */
.corner-decoration {
    position: absolute;
    width: 100px;
    height: 100px;
    pointer-events: none;
    z-index: 0;
}

.corner-decoration::before,
.corner-decoration::after {
    content: '';
    position: absolute;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), transparent);
}

.corner-decoration::before {
    width: 100%;
    height: 2px;
}

.corner-decoration::after {
    width: 2px;
    height: 100%;
}

.corner-decoration.top-left {
    top: 0;
    left: 0;
}

.corner-decoration.top-right {
    top: 0;
    right: 0;
    transform: rotate(90deg);
}

.corner-decoration.bottom-left {
    bottom: 0;
    left: 0;
    transform: rotate(-90deg);
}

.corner-decoration.bottom-right {
    bottom: 0;
    right: 0;
    transform: rotate(180deg);
}

/* Floating emoji stickers */
.emoji-sticker {
    position: absolute;
    font-size: 3rem;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    animation: emoji-float 10s ease-in-out infinite;
}

@keyframes emoji-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(10deg);
    }
}

/* Section decorations */
.section-decoration {
    position: relative;
    overflow: hidden;
}

.section-decoration::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
