/* ============================================================
   金山打字通 - 全新视觉设计
   现代暗色主题 · 渐变光效 · 流畅动效
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-card-hover: #1e1e2a;
    --border: rgba(255, 255, 255, 0.06);
    --border-active: rgba(100, 160, 255, 0.3);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #555568;
    --accent: #4f8cff;
    --accent-light: #7aadff;
    --accent-glow: rgba(79, 140, 255, 0.25);
    --gradient-1: linear-gradient(135deg, #4f8cff 0%, #7c5cfc 50%, #a855f7 100%);
    --gradient-2: linear-gradient(135deg, #4f8cff 0%, #06b6d4 100%);
    --gradient-hero: linear-gradient(180deg, #0a0a0f 0%, #111118 40%, #161620 100%);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 60px rgba(79, 140, 255, 0.15);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Animated Background ---------- */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse 800px 600px at 20% 20%, rgba(79, 140, 255, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 600px 500px at 80% 60%, rgba(124, 92, 252, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 500px 400px at 50% 80%, rgba(6, 182, 212, 0.03) 0%, transparent 70%);
    animation: bgShift 20s ease-in-out infinite;
}

@keyframes bgShift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -1%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

/* Grid pattern overlay */
.animated-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ---------- Header / Navbar ---------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 32px;
    height: 64px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition);
}

.header.scrolled {
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.header-inner {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 4px 16px rgba(79, 140, 255, 0.3);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.logo-text span {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #fff;
    background: rgba(79, 140, 255, 0.15);
}

.nav-btn {
    background: var(--gradient-1);
    color: #fff;
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(79, 140, 255, 0.3);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(79, 140, 255, 0.45);
}

/* ---------- Hero Section ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 120px 32px 80px;
}

.hero-container {
    max-width: 1100px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 80px;
}

.hero-text {
    flex: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-light);
    background: rgba(79, 140, 255, 0.1);
    border: 1px solid rgba(79, 140, 255, 0.2);
    margin-bottom: 24px;
    animation: fadeInUp 0.8s ease-out;
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(79, 140, 255, 0.6); }
    50% { opacity: 0.6; box-shadow: 0 0 0 8px rgba(79, 140, 255, 0); }
}

.hero-title {
    font-size: clamp(42px, 6vw, 64px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero-title .gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 36px;
    max-width: 480px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 32px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.2px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 主按钮 - 渐变发光 */
.btn-primary {
    background: var(--gradient-1);
    color: #fff;
    box-shadow: 
        0 8px 32px rgba(79, 140, 255, 0.35),
        0 0 0 0 rgba(79, 140, 255, 0.4);
    animation: btnGlowPulse 3s ease-in-out infinite;
}

@keyframes btnGlowPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(79, 140, 255, 0.35), 0 0 0 0 rgba(79, 140, 255, 0.4); }
    50% { box-shadow: 0 8px 32px rgba(79, 140, 255, 0.35), 0 0 0 12px rgba(79, 140, 255, 0); }
}

.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: left 0.6s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 
        0 14px 44px rgba(79, 140, 255, 0.55),
        0 0 0 0 rgba(79, 140, 255, 0.4);
    animation: none;
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

/* 主按钮内图标 */
.btn-primary svg {
    transition: transform 0.3s ease;
}

.btn-primary:hover svg {
    transform: translateY(2px);
}

/* 次按钮 - 毛玻璃边框 */
.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-outline::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 100px;
    padding: 1px;
    background: var(--gradient-1);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.btn-outline:hover {
    border-color: rgba(124, 92, 252, 0.5);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 32px rgba(79, 140, 255, 0.12);
}

.btn-outline:hover::after {
    opacity: 1;
}

.btn-outline:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.btn-outline svg {
    transition: transform 0.3s ease;
}

.btn-outline:hover svg {
    transform: translateX(3px);
}

.btn-lg {
    padding: 18px 40px;
    font-size: 16px;
    gap: 12px;
}

/* Hero visual - 3D keyboard */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.keyboard-3d {
    perspective: 800px;
}

.keyboard-3d-inner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    transform: rotateY(-8deg) rotateX(6deg);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px var(--accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform var(--transition-slow);
}

.keyboard-3d-inner:hover {
    transform: rotateY(-3deg) rotateX(3deg);
}

.key-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    justify-content: center;
}

.key-row:last-child {
    margin-bottom: 0;
}

.keycap {
    width: 44px;
    height: 44px;
    background: linear-gradient(180deg, #1e1e2e 0%, #12121a 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: 
        0 3px 0 rgba(0, 0, 0, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.15s ease;
    cursor: default;
    user-select: none;
}

.keycap.active {
    background: var(--gradient-1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 0 0 rgba(0, 0, 0, 0),
        0 0 20px rgba(79, 140, 255, 0.5);
    transform: translateY(2px);
}

.keycap.space {
    width: 240px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ---------- Stats Section ---------- */
.stats {
    padding: 0 32px;
    position: relative;
    z-index: 1;
    margin-top: -60px;
}

.stats-grid {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-2);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-active);
    box-shadow: var(--shadow-glow);
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ---------- Features Section ---------- */
.features {
    padding: 120px 32px;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 72px;
}

.section-label {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-light);
    background: rgba(79, 140, 255, 0.1);
    border: 1px solid rgba(79, 140, 255, 0.2);
    margin-bottom: 16px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.section-title {
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 16px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 18px;
    max-width: 500px;
    margin: 0 auto;
}

.features-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity var(--transition);
    z-index: 0;
    border-radius: var(--radius-lg);
}

.feature-card:hover::after {
    opacity: 0.03;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-active);
    box-shadow: var(--shadow-glow);
}

.feature-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(79, 140, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    transition: all var(--transition);
}

.feature-card:hover .feature-icon-wrap {
    background: var(--gradient-1);
    box-shadow: 0 8px 24px rgba(79, 140, 255, 0.3);
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* ---------- CTA Section ---------- */
.cta-section {
    padding: 100px 32px;
    position: relative;
    z-index: 1;
}

.cta-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 140, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.cta-card h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    position: relative;
}

.cta-card p {
    color: var(--text-secondary);
    font-size: 17px;
    margin-bottom: 32px;
    position: relative;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    position: relative;
}

/* ---------- Download Page ---------- */
.download-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 120px 32px 60px;
}

.download-card-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.download-card-wrap::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 1px;
    background: var(--gradient-2);
}

.dl-icon {
    width: 80px;
    height: 80px;
    border-radius: 22px;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 24px;
    box-shadow: 0 12px 40px rgba(79, 140, 255, 0.35);
}

.dl-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.dl-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.dl-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 28px;
    text-align: left;
}

.dl-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.dl-info-row:last-child {
    border-bottom: none;
}

.dl-info-label {
    color: var(--text-muted);
    font-size: 14px;
}

.dl-info-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.dl-info-value.highlight {
    color: var(--accent-light);
}

.dl-btn {
    width: 100%;
    justify-content: center;
    font-size: 17px;
    padding: 18px;
    margin-bottom: 20px;
}

.dl-back {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition);
}

.dl-back:hover {
    color: var(--accent-light);
}

/* ---------- 404 Page ---------- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 120px 32px 60px;
}

.error-content {
    text-align: center;
}

.error-glitch {
    font-size: clamp(100px, 20vw, 180px);
    font-weight: 900;
    line-height: 1;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    margin-bottom: 8px;
    letter-spacing: -4px;
    animation: glitch 2s ease-in-out infinite;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-3px, 2px); }
    40% { transform: translate(3px, -1px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 1px); }
}

.error-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
}

.error-desc {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 36px;
}

.error-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 40px 32px;
    color: var(--text-muted);
    font-size: 13px;
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--transition-slow);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 48px;
    }

    .hero-desc {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .keyboard-3d-inner {
        transform: rotateY(0) rotateX(4deg);
    }

    .keycap {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .keycap.space {
        width: 180px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 0 16px;
    }

    .nav-links {
        gap: 0;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }

    .nav-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .hero {
        padding: 100px 20px 40px;
    }

    .features {
        padding: 80px 20px;
    }

    .cta-section {
        padding: 60px 20px;
    }

    .cta-card {
        padding: 40px 24px;
    }

    .download-card-wrap {
        padding: 36px 24px;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }
}
