/* ========================================
   Beijing Xiaoweishi - Main Stylesheet
   Version: 1.0.0
   Author: Beijing Xiaoweishi Security Technology Co., Ltd.
   ======================================== */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Colors */
    --primary-color: #0066CC;
    --primary-dark: #003366;
    --primary-light: #4DA6FF;
    --secondary-color: #003366;
    --accent-color: #4DA6FF;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0066CC 0%, #003366 100%);
    --gradient-hero: linear-gradient(135deg, rgba(0, 102, 204, 0.9) 0%, rgba(0, 51, 102, 0.95) 100%);
    
    /* Typography */
    --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 5rem;
    
    /* Transitions */
    --transition-fast: all 0.3s ease;
    --transition-normal: all 0.5s ease;
    --transition-slow: all 0.8s ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.25);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ========================================
   Container & Layout
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-sm);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
}

/* ========================================
   Header & Navigation
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-fixed);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

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

.logo-svg {
    height: 50px;
    width: auto;
}

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

.nav-list {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-link {
    font-weight: 500;
    color: #333;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

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

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-fast);
    padding: var(--spacing-sm) 0;
    z-index: var(--z-dropdown);
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #333;
    font-size: 0.95rem;
}

.dropdown-content a:hover {
    background: var(--primary-color);
    color: white;
}

.nav-toggle,
.nav-close {
    display: none;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--gradient-hero);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(77, 166, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(0, 102, 204, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.85) 0%, rgba(0, 51, 102, 0.9) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xxl);
    align-items: center;
    padding: 8rem 0 4rem;
}

.hero-text {
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-lg);
    line-height: 1.1;
}

.hero-title-line {
    display: block;
}

.hero-description {
    font-size: 1.25rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-xl);
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-shield {
    width: 100%;
    max-width: 400px;
    height: auto;
    animation: float 6s ease-in-out infinite;
}

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

.hero-scroll {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    opacity: 0.8;
}

.scroll-indicator {
    width: 30px;
    height: 50px;
    border: 2px solid white;
    border-radius: 15px;
    margin: 1rem auto 0;
    position: relative;
}

.scroll-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0% { top: 8px; opacity: 1; }
    100% { top: 32px; opacity: 0; }
}

/* ========================================
   Stats Section
   ======================================== */
.stats {
    padding: var(--spacing-xxl) 0;
    background: white;
    margin-top: -3rem;
    position: relative;
    z-index: 2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-lg);
    position: relative;
}

.stat-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: #e0e0e0;
}

.stat-item:last-child::after {
    display: none;
}

.stat-icon {
    margin-bottom: var(--spacing-md);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

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

.section-title {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-md);
}

.section-subtitle {
    font-size: 1.125rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Services Preview Section
   ======================================== */
.services-preview {
    padding: var(--spacing-xxl) 0;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.service-card {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-normal);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

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

.service-icon {
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

.service-title {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
}

.service-description {
    color: #666;
    margin-bottom: var(--spacing-md);
    line-height: 1.7;
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--primary-color);
    font-weight: 600;
}

.service-link svg {
    transition: var(--transition-fast);
}

.service-link:hover svg {
    transform: translateX(5px);
}

/* ========================================
   About Section
   ======================================== */
.about {
    padding: var(--spacing-xxl) 0;
    background: white;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xxl);
    align-items: center;
}

.about-content .section-title {
    text-align: left;
}

.about-text {
    color: #666;
    line-height: 1.8;
    margin-bottom: var(--spacing-lg);
}

.about-features {
    margin: var(--spacing-xl) 0;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    color: var(--primary-dark);
    font-weight: 500;
}

.feature-item svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.about-visual {
    display: flex;
    justify-content: center;
}

.about-illustration {
    width: 100%;
    max-width: 500px;
    height: auto;
}

/* ========================================
   Mobile Apps Section
   ======================================== */
.mobile-apps {
    padding: var(--spacing-xxl) 0;
    background: linear-gradient(180deg, #f0f4f8 0%, #ffffff 100%);
}

.apps-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xxl);
    align-items: center;
}

.app-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.app-feature {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.feature-icon {
    color: var(--primary-color);
    flex-shrink: 0;
}

.app-feature h3 {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-xs);
}

.app-feature p {
    color: #666;
    line-height: 1.7;
}

.app-downloads {
    display: flex;
    justify-content: center;
}

.app-phones {
    width: 100%;
    max-width: 300px;
    height: auto;
}

/* ========================================
   News Preview Section
   ======================================== */
.news-preview {
    padding: var(--spacing-xxl) 0;
    background: white;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.news-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.news-content {
    padding: var(--spacing-lg);
}

.news-date {
    font-size: 0.875rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.news-title {
    font-size: 1.125rem;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.news-excerpt {
    color: #666;
    line-height: 1.7;
    margin-bottom: var(--spacing-md);
}

.news-link {
    color: var(--primary-color);
    font-weight: 600;
}

.news-link:hover {
    color: var(--primary-dark);
}

.news-cta {
    text-align: center;
}

/* ========================================
   CTA Section
   ======================================== */
.cta {
    padding: var(--spacing-xxl) 0;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.cta-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.cta-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.cta-description {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: var(--spacing-xl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--primary-dark);
    color: white;
}

.footer-main {
    padding: var(--spacing-xxl) 0 var(--spacing-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: var(--spacing-xl);
}

.footer-logo {
    display: inline-block;
    margin-bottom: var(--spacing-md);
}

.footer-logo .logo-svg {
    height: 50px;
}

.footer-description {
    line-height: 1.8;
    opacity: 0.8;
    margin-bottom: var(--spacing-lg);
}

.footer-social {
    display: flex;
    gap: var(--spacing-md);
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.social-link:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-title {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-lg);
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    opacity: 0.8;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--primary-light);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.contact-item {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-start;
    opacity: 0.8;
}

.contact-item svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: var(--spacing-lg) 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    opacity: 0.8;
    font-size: 0.95rem;
}

.legal-links {
    display: flex;
    gap: var(--spacing-lg);
}

.legal-links a {
    opacity: 0.8;
    font-size: 0.95rem;
}

.legal-links a:hover {
    opacity: 1;
    color: var(--primary-light);
}

/* ========================================
   Animations
   ======================================== */
[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate="fadeInUp"] {
    transform: translateY(30px);
}

[data-animate="fadeInLeft"] {
    transform: translateX(-30px);
}

[data-animate="fadeInRight"] {
    transform: translateX(30px);
}

[data-animate].animated {
    opacity: 1;
    transform: translate(0);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .hero-shield {
        max-width: 300px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-item:nth-child(2)::after {
        display: none;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .about-content .section-title {
        text-align: center;
    }
    
    .apps-showcase {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.3s;
        box-shadow: var(--shadow-xl);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-link {
        font-size: 1.25rem;
        padding: 1rem;
    }
    
    .dropdown-content {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
    }
    
    .dropdown-content a {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
    
    .nav-toggle,
    .nav-close {
        display: block;
        z-index: var(--z-modal);
    }
    
    .nav-close {
        position: absolute;
        top: 2rem;
        right: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-item::after {
        display: none;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-title {
        font-size: 1.75rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .contact-item {
        justify-content: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .btn-large {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* ========================================
   Loading Animation
   ======================================== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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