/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== 主题色彩系统 ========== */
:root {
    /* 暗色主题 (默认) */
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-card-hover: rgba(59, 130, 246, 0.1);
    
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --accent-primary: #3B82F6;
    --accent-secondary: #8B5CF6;
    --accent-tertiary: #10B981;
    
    --border-color: rgba(59, 130, 246, 0.2);
    --border-hover: rgba(59, 130, 246, 0.5);
    
    --shadow-color: rgba(0, 0, 0, 0.3);
    --glow-color: rgba(59, 130, 246, 0.5);
}

/* 亮色主题 */
[data-theme="light"] {
    --bg-primary: #F8FAFC;
    --bg-secondary: #E2E8F0;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(59, 130, 246, 0.1);
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    
    --border-color: rgba(59, 130, 246, 0.3);
    --border-hover: rgba(59, 130, 246, 0.6);
    
    --shadow-color: rgba(0, 0, 0, 0.1);
    --glow-color: rgba(59, 130, 246, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ========== 导航栏样式 ========== */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

[data-theme="light"] .nav-bar {
    background: rgba(248, 250, 252, 0.95);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-primary);
    text-decoration: none;
}

.nav-logo img {
    height: 35px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    padding: 8px 16px;
    border-radius: 6px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-primary);
}

/* 主题切换按钮组 */
.theme-switcher {
    display: flex;
    gap: 5px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
}

.theme-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.theme-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(59, 130, 246, 0.6);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 900px;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.logo {
    width: 180px;
    height: 180px;
    position: relative;
    z-index: 2;
    animation: pulse-glow 3s ease-in-out infinite;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow-pulse 3s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.8));
    }
}

@keyframes glow-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

.title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-height: 4.5rem;
}
/* Fallback: show solid color if gradient text not supported */
@supports not (-webkit-background-clip: text) {
    .title {
        color: var(--accent-primary);
        background: none;
        -webkit-text-fill-color: var(--accent-primary);
    }
}

.cursor {
    animation: blink 1s infinite;
    -webkit-text-fill-color: var(--accent-primary);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tag {
    color: var(--text-primary);
}

.divider {
    color: var(--text-muted);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.5);
}

.button-arrow {
    transition: transform 0.3s ease;
}

.cta-button:hover .button-arrow {
    transform: translateX(5px);
}

/* Features Section */
.features {
    padding: 6rem 2rem;
    position: relative;
    z-index: 1;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--accent-primary);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
@supports not (-webkit-background-clip: text) {
    .section-title {
        color: var(--accent-primary);
        background: none;
        -webkit-text-fill-color: var(--accent-primary);
    }
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(30px);
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--border-hover);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.card-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.card-link:hover {
    color: var(--accent-tertiary);
}

/* Download Section */
.download {
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.version-info {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.download-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem 2.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    min-width: 180px;
}

.download-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    transform: translateY(-5px);
}

.os-icon {
    font-size: 3rem;
}

.os-name {
    font-size: 1.3rem;
    font-weight: 600;
}

.download-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.npm-install {
    max-width: 600px;
    margin: 0 auto;
}

.npm-label {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.code-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    gap: 1rem;
}

.code-block code {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: var(--accent-tertiary);
}

.copy-btn {
    background: rgba(59, 130, 246, 0.2);
    border: none;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(59, 130, 246, 0.4);
}

/* Stats Section */
.stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding: 4rem 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-primary);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}
@supports not (-webkit-background-clip: text) {
    .stat-number {
        color: var(--accent-primary);
        background: none;
        -webkit-text-fill-color: var(--accent-primary);
    }
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .divider {
        display: none;
    }
    
    .logo {
        width: 140px;
        height: 140px;
    }
    
    .stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .nav-bar {
        flex-wrap: wrap;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .theme-switcher {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-top: 15px;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .feature-cards {
        grid-template-columns: 1fr;
    }
    
    .download-btn {
        width: 100%;
    }
}

/* Mobile hardening patch: 2026-04-13 */
.title {
    line-height: 1.2;
    word-break: break-word;
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    .nav-bar {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo theme"
            "links links";
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
    }

    .nav-logo {
        grid-area: logo;
        font-size: 1.08rem;
        max-width: 100%;
        min-width: 0;
    }

    .nav-logo img {
        height: 24px;
    }

    .theme-switcher {
        grid-area: theme;
        width: auto;
        justify-content: flex-end;
        margin: 0;
        padding: 0;
        border: none;
        gap: 4px;
    }

    .theme-btn {
        padding: 4px 8px;
        font-size: 0.76rem;
    }

    .nav-links {
        grid-area: links;
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        white-space: nowrap;
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .hero {
        min-height: calc(100dvh - 64px);
        padding: 1.25rem 1rem 1.8rem;
    }

    .hero-content {
        width: 100%;
        max-width: 100%;
    }

    .logo {
        width: 108px;
        height: 108px;
    }

    .logo-glow {
        width: 126px;
        height: 126px;
    }

    .title {
        font-size: 1.9rem;
        min-height: auto;
        margin-bottom: 0.9rem;
    }

    .subtitle {
        font-size: 1rem;
        flex-direction: column;
        gap: 0.35rem;
        margin-bottom: 1.5rem;
    }

    .divider {
        display: none;
    }

    .cta-button {
        width: 100%;
        max-width: 320px;
        justify-content: center;
        font-size: 1rem;
        padding: 0.9rem 1.1rem;
    }

    .features,
    .download {
        padding: 3.8rem 1rem;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .feature-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.4rem;
        border-radius: 14px;
    }

    .download-btn {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        padding: 1.2rem 1rem;
    }

    .stats {
        gap: 1.2rem;
        padding: 2.2rem 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .footer-links {
        gap: 0.9rem;
        font-size: 0.92rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.6rem;
    }

    .logo {
        width: 88px;
        height: 88px;
    }

    .logo-glow {
        width: 102px;
        height: 102px;
    }

    .section-title {
        font-size: 1.55rem;
    }

    .download-buttons {
        gap: 0.85rem;
    }
}
