/* ============================
   MeifuAI - Premium Stylesheet
   ============================ */

:root {
    --bg-primary: #050816;
    --bg-secondary: #0a0f1e;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-card-hover: rgba(20, 30, 55, 0.7);
    --text-primary: #f0f4ff;
    --text-secondary: #94a3c0;
    --text-muted: #5a6680;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-secondary: #a855f7;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-glow-strong: rgba(99, 102, 241, 0.25);
    --gradient-accent: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    --gradient-accent-text: linear-gradient(135deg, #818cf8 0%, #c084fc 40%, #f472b6 100%);
    --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
                     radial-gradient(ellipse 60% 40% at 80% 50%, rgba(168, 85, 247, 0.08), transparent),
                     radial-gradient(ellipse 60% 40% at 20% 80%, rgba(236, 72, 153, 0.06), transparent),
                     linear-gradient(180deg, #050816 0%, #0a0f1e 40%, #080d1a 100%);
    --border: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(99, 102, 241, 0.2);
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius: 14px;
    --radius-lg: 24px;
    --shadow-card: 0 25px 60px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 80px -20px rgba(99, 102, 241, 0.2);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

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

/* ============================
   Background Effects
   ============================ */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    animation: float-glow 20s ease-in-out infinite;
}

.bg-glow-1 {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
    top: -300px;
    left: -200px;
}

.bg-glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1), transparent 70%);
    bottom: -200px;
    right: -150px;
    animation-delay: -10s;
}

.bg-glow-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.07), transparent 70%);
    top: 40%;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float-glow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
}

/* ============================
   Navbar
   ============================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 32px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(5, 8, 22, 0.7);
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background: rgba(5, 8, 22, 0.92);
    border-bottom-color: var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3), 0 0 60px -20px rgba(99, 102, 241, 0.1);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-light);
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.logo-text {
    font-family: var(--font-display);
    font-size: 22px;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 36px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    position: relative;
    letter-spacing: 0.3px;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: -4px;
    right: -4px;
    height: 2px;
    background: var(--gradient-accent);
    border-radius: 1px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login {
    font-size: 14px;
    font-weight: 500;
    padding: 9px 24px;
    border-radius: 10px;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.03);
    transition: all var(--transition);
    letter-spacing: 0.3px;
}

.btn-login:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: var(--accent-glow);
    box-shadow: 0 0 20px -5px rgba(99, 102, 241, 0.2);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ============================
   Hero Section
   ============================ */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 24px 100px;
    background: var(--gradient-hero);
}

.hero::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08), transparent 60%);
    pointer-events: none;
    filter: blur(80px);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-light);
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 7vw, 80px);
    font-weight: 400;
    line-height: 1.08;
    margin-bottom: 28px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-title em {
    font-style: italic;
    background: var(--gradient-accent-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: clamp(17px, 2.2vw, 22px);
    color: var(--text-secondary);
    max-width: 640px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.hero-sub {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 520px;
    margin-bottom: 48px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 80px;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    background: var(--gradient-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.45), 0 0 60px -10px rgba(168, 85, 247, 0.2);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-light);
    background: var(--accent-glow);
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 48px;
    font-size: 17px;
    border-radius: 14px;
}

/* ============================
   Terminal
   ============================ */
.terminal-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.terminal-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.06), transparent 60%);
    pointer-events: none;
}

.terminal-window {
    width: 560px;
    max-width: 90vw;
    background: linear-gradient(160deg, rgba(20, 27, 45, 0.95), rgba(10, 15, 30, 0.98));
    border-radius: 18px;
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(99, 102, 241, 0.1),
        inset 0 1px rgba(255, 255, 255, 0.06);
    overflow: hidden;
    transform: perspective(1200px) rotateX(2deg) rotateY(-3deg);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.terminal-window:hover {
    transform: perspective(1200px) rotateX(0) rotateY(0) translateY(-6px);
    box-shadow:
        0 40px 80px -20px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(99, 102, 241, 0.2),
        0 0 60px -10px rgba(99, 102, 241, 0.1),
        inset 0 1px rgba(255, 255, 255, 0.06);
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn-close { background: #ef4444; }
.btn-minimize { background: #eab308; }
.btn-maximize { background: #22c55e; }

.terminal-title {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-family: ui-monospace, monospace;
    color: var(--text-muted);
    margin-right: 52px;
    letter-spacing: 1px;
}

.terminal-body {
    padding: 24px 28px;
    font-family: ui-monospace, 'Fira Code', monospace;
    font-size: 14px;
    line-height: 2;
}

.code-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    opacity: 0;
    animation: line-appear 0.5s ease forwards;
}

.line-1 { animation-delay: 0.3s; }
.line-2 { animation-delay: 1.0s; }
.line-3 { animation-delay: 1.8s; }
.line-4 { animation-delay: 2.5s; }
.line-5 { animation-delay: 3.2s; }

@keyframes line-appear {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.code-prompt { color: #a78bfa; font-weight: 700; }
.code-cmd { color: #60a5fa; }
.code-flag { color: #c084fc; }
.code-url { color: #818cf8; }
.code-comment { color: var(--text-muted); font-style: italic; }
.code-success {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 600;
}
.code-response { color: #fbbf24; }

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #a78bfa;
    animation: blink 1s step-end infinite;
}

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

.terminal-link {
    font-size: 13px;
    color: var(--accent-light);
    transition: all var(--transition);
    letter-spacing: 0.3px;
}

.terminal-link:hover {
    color: #c084fc;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

/* ============================
   Features Section
   ============================ */
.features {
    position: relative;
    z-index: 1;
    padding: 100px 24px;
    max-width: 1280px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 36px 32px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.feature-card:hover {
    border-color: rgba(99, 102, 241, 0.15);
    background: var(--bg-card-hover);
    transform: translateY(-6px);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 60px -15px rgba(99, 102, 241, 0.1);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 24px;
}

.feature-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.feature-desc {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ============================
   Models Section
   ============================ */
.models {
    position: relative;
    z-index: 1;
    padding: 100px 24px;
    overflow: hidden;
}

.section-title {
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 400;
    margin-bottom: 56px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.models-marquee {
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
    display: flex;
    gap: 20px;
    animation: marquee 30s linear infinite;
    width: max-content;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-track:hover {
    animation-play-state: paused;
}

.model-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 28px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    white-space: nowrap;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.model-item:hover {
    border-color: rgba(99, 102, 241, 0.25);
    background: var(--accent-glow);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 40px -10px rgba(99, 102, 241, 0.1);
}

.model-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.model-logo.openai { background: linear-gradient(135deg, #1a7f64, #0d9488); }
.model-logo.openai::after { content: 'GPT'; font-size: 10px; }
.model-logo.anthropic { background: linear-gradient(135deg, #d97706, #b45309); }
.model-logo.anthropic::after { content: 'CL'; font-size: 12px; }
.model-logo.google { background: linear-gradient(135deg, #4285f4, #34a853); }
.model-logo.google::after { content: 'G'; font-size: 16px; }
.model-logo.zhipu { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.model-logo.zhipu::after { content: 'GLM'; font-size: 9px; }
.model-logo.moonshot { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.model-logo.moonshot::after { content: 'K'; font-size: 16px; }
.model-logo.minimax { background: linear-gradient(135deg, #ec4899, #db2777); }
.model-logo.minimax::after { content: 'MM'; font-size: 10px; }
.model-logo.qwen { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.model-logo.qwen::after { content: 'Q'; font-size: 16px; }
.model-logo.more { background: linear-gradient(135deg, #64748b, #475569); }
.model-logo.more::after { content: '+'; font-size: 18px; }

.model-item span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ============================
   CTA Section
   ============================ */
.cta {
    position: relative;
    z-index: 1;
    padding: 140px 24px;
    text-align: center;
}

.cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.08), transparent 60%);
    pointer-events: none;
    filter: blur(60px);
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-title {
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 52px);
    font-weight: 400;
    margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.cta-title em {
    font-style: italic;
    background: var(--gradient-accent-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cta-desc {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 44px;
    line-height: 1.7;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* ============================
   Footer
   ============================ */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 48px 24px;
    background: rgba(5, 8, 22, 0.5);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--text-secondary);
}

.footer-brand .logo-icon {
    width: 22px;
    height: 22px;
    color: var(--accent-light);
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-muted);
    transition: all var(--transition);
}

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

.footer-copyright {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================
   Animations
   ============================ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================
   Responsive Design
   ============================ */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .nav-links.active {
        display: flex;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(5, 8, 22, 0.98);
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border);
    }

    .hero {
        padding: 110px 16px 60px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .features {
        padding: 60px 16px;
    }

    .models {
        padding: 60px 16px;
    }

    .cta {
        padding: 80px 16px;
    }

    .terminal-window {
        transform: none;
    }

    .terminal-window:hover {
        transform: translateY(-2px);
    }

    .terminal-body {
        font-size: 12px;
    }

    .footer-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

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

    .terminal-body {
        padding: 16px;
    }

    .hero-actions {
        margin-bottom: 48px;
    }
}