/* Reusable Components */

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
    transition: all var(--transition-normal);
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
    transition: all var(--transition-normal);
}

nav.scrolled,
.navbar.scrolled {
    background: rgba(10, 22, 40, 0.98);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-logo-link {
    text-decoration: none;
    transition: opacity 0.2s ease;
    outline: none; /* 移除焦点轮廓 */
}

.nav-logo-link:hover {
    opacity: 0.8;
}

.nav-logo-link:focus {
    outline: none; /* 确保焦点时也没有轮廓 */
    opacity: 0.8; /* 焦点时也有视觉反馈 */
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-logo .text-brand-primary { 
    color: var(--bright-cyan); 
}

.nav-logo .text-brand-secondary { 
    color: white; 
}

.nav-menu-desktop {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    margin: 0;
    padding: 0;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 6px;
    transition: all var(--transition-normal);
    position: relative;
    font-size: 0.875rem;
    font-weight: 500;
    outline: none; /* 移除焦点轮廓 */
}

.nav-link:hover,
.nav-link.active {
    color: var(--bright-cyan);
}

.nav-link:focus {
    outline: none; /* 确保焦点时也没有轮廓 */
    color: var(--bright-cyan); /* 焦点时也有视觉反馈 */
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--bright-cyan);
    animation: slideIn var(--transition-normal);
}

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

/* Mobile Menu */
.nav-mobile-toggle {
    display: none;
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color var(--transition-normal);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    outline: none; /* 移除焦点轮廓 */
}

.mobile-menu-btn:hover {
    color: white;
}

.mobile-menu-btn:focus {
    outline: none; /* 确保焦点时也没有轮廓 */
    color: white;
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(10, 22, 40, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(6, 182, 212, 0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    will-change: opacity, transform;
}

.mobile-menu.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    will-change: auto;
}

.mobile-nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: var(--spacing-sm);
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
    font-weight: 500;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    outline: none; /* 移除焦点轮廓 */
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--bright-cyan);
    background: rgba(6, 182, 212, 0.1);
}

.mobile-nav-link:focus {
    outline: none; /* 确保焦点时也没有轮廓 */
    color: var(--bright-cyan);
    background: rgba(6, 182, 212, 0.1);
}

.mobile-nav-link:active {
    transform: scale(0.98);
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-menu-desktop {
        display: none;
    }
    
    .nav-mobile-toggle {
        display: block;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    font-family: inherit;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:focus {
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--bright-cyan), var(--electric-blue));
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4), 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4), 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-accent {
    background: linear-gradient(135deg, var(--amber-glow), var(--orange-accent));
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4), 0 0 20px rgba(251, 146, 60, 0.3);
}

.btn-accent:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4), 0 0 20px rgba(251, 146, 60, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--bright-cyan);
    border: 2px solid var(--bright-cyan);
    position: relative;
}

.btn-outline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--bright-cyan), var(--electric-blue));
    transition: width 0.4s ease;
    z-index: -1;
    border-radius: 50px;
}

.btn-outline:hover {
    color: white;
    border-color: var(--electric-blue);
}

.btn-outline:hover::after {
    width: 100%;
}

.btn-outline:focus {
    color: white;
    border-color: var(--electric-blue);
}

/* Cards */
.card {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(6, 182, 212, 0.03) 50%, 
        rgba(255, 255, 255, 0.08) 100%);
    border-radius: 16px;
    padding: var(--spacing-md);
    border: 1px solid rgba(6, 182, 212, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 8px 25px rgba(0, 0, 0, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--bright-cyan), var(--electric-blue), var(--vivid-purple));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover {
    border-color: var(--bright-cyan);
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(6, 182, 212, 0.05) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 10px 30px rgba(6, 182, 212, 0.2),
        0 0 40px rgba(59, 130, 246, 0.1);
}

.card:hover::before {
    transform: scaleX(1);
}

/* Card tilt effect - will be controlled by JS */
.card.tilt-enabled {
    transition: transform 0.1s ease-out;
}

.card-header {
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.card-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, white, var(--bright-cyan), var(--electric-blue));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    animation: gradientShift 6s ease-in-out infinite;
}

.section-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 900px;
    margin: 0 auto;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--bright-cyan);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
    outline: none; /* 移除焦点轮廓 */
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #0891B2;
    transform: translateY(-2px);
}

.back-to-top:focus {
    outline: none; /* 确保焦点时也没有轮廓 */
    background: #0891B2;
    transform: translateY(-2px);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(6, 182, 212, 0.3);
    border-top: 3px solid var(--bright-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.8));
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(75, 85, 99, 0.5);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.stat-card:hover {
    border-color: var(--bright-cyan);
}

.stat-card.cyan:hover {
    border-color: var(--bright-cyan);
}

.stat-card.blue:hover {
    border-color: #3B82F6;
}

.stat-card.purple:hover {
    border-color: #A855F7;
}

.stat-card.green:hover {
    border-color: #10B981;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-value.cyan {
    color: var(--bright-cyan);
}

.stat-value.blue {
    color: #3B82F6;
}

.stat-value.purple {
    color: #A855F7;
}

.stat-value.green {
    color: #10B981;
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(209, 213, 219, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    word-break: break-words;
}

/* Reduce animations on mobile for better performance */
@media (max-width: 768px) {
    /* Disable heavy animations on mobile */
    .grid-background,
    .tech-grid-background,
    .timeline-scanner,
    .data-stream-effect {
        animation: none !important;
    }
    
    /* Reduce backdrop-filter blur on mobile for performance */
    nav,
    .navbar,
    .mobile-menu,
    .card,
    .presence-card,
    .product-card,
    .contact-card {
        backdrop-filter: blur(5px) !important;
    }
    
    /* Simplify hover effects on mobile */
    .card:hover,
    .presence-card:hover,
    .product-card:hover {
        transform: none !important;
    }
    
    /* Disable complex animations on mobile */
    .timeline-marker {
        animation: none !important;
    }
}