/* Base Styles */
[v-cloak] { display: none; }
html { 
    scroll-behavior: smooth; 
    overflow-x: hidden; 
    -webkit-overflow-scrolling: touch;
}
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #d1d5db;
    background-color: #0a0a0a;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Prevent horizontal scroll on all elements */
img, video, iframe, object, embed {
    max-width: 100%;
    height: auto;
}

/* Image loading optimization */
img {
    object-fit: cover;
    background-color: #1a1a1a;
    opacity: 1 !important;
    transition: opacity 0.3s ease;
}

/* 确保懒加载图片总能显示 */
img[loading="lazy"] {
    opacity: 1;
}

img.loaded {
    opacity: 1;
}

/* Performance optimization - GPU acceleration */
.transform-gpu {
    transform: translateZ(0);
    backface-visibility: hidden;
}

.will-change-contents {
    will-change: contents;
}

.will-change-scroll {
    will-change: scroll-position;
}

/* Optimized animations */
.animate-better {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* Reduce touch delay */
button, a, [role="button"] {
    touch-action: manipulation;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #ef4444;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* Vue Transitions */
.fade-enter-active, .fade-leave-active { 
    transition: opacity 0.3s ease; 
}
.fade-enter-from, .fade-leave-to { 
    opacity: 0; 
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #121212;
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Selection */
::selection {
    background: rgba(220, 38, 38, 0.4);
    color: white;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Prose Styles */
.content-box p {
    margin-bottom: 1rem;
}
.content-box h3 {
    color: #ffffff;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.content-box ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.content-box li {
    margin-bottom: 0.5rem;
}
.content-box strong {
    color: #ffffff;
}
.content-box a {
    color: #ef4444;
    text-decoration: underline;
}

/* Language Switcher Styles */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-switcher button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.lang-switcher button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.lang-switcher button.active {
    background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .lang-switcher {
        gap: 2px;
        padding: 2px;
    }
    
    .lang-switcher button {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* Ad Container Styles */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Sticky Anchor Ad Optimization */
.ad-anchor-container {
    min-height: 50px;
}

/* Ensure ads are responsive */
.ad-container iframe {
    max-width: 100%;
}

/* Mobile padding for anchor ad */
@media (max-width: 640px) {
    footer {
        padding-bottom: 60px !important;
    }
}
