/* ============================================
   快连官网 全局样式 (Cyber Minimalism)
   Design System: Dark + Neon Cyan + Hard Edge
   ============================================ */

:root {
    /* 色彩系统 */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1424;
    --bg-elevated: #161c30;
    --bg-card: rgba(22, 28, 48, 0.6);
    --bg-overlay: rgba(10, 14, 26, 0.85);

    --accent: #00e5ff;
    --accent-dim: #00b8d4;
    --accent-glow: rgba(0, 229, 255, 0.4);
    --accent-glow-soft: rgba(0, 229, 255, 0.08);

    --text-primary: #e8eef7;
    --text-secondary: #8b97ad;
    --text-muted: #4a5570;
    --text-accent: #00e5ff;

    --border: rgba(139, 151, 173, 0.15);
    --border-strong: rgba(139, 151, 173, 0.3);
    --border-accent: rgba(0, 229, 255, 0.3);

    --success: #00e676;
    --warning: #ffab00;
    --danger: #ff5252;

    /* 字体系统 */
    --font-display: 'Space Grotesk', 'Noto Sans SC', system-ui, sans-serif;
    --font-body: 'Noto Sans SC', 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* 尺寸系统 */
    --container: 1280px;
    --container-wide: 1440px;
    --header-h: 64px;
    --topbar-h: 32px;

    /* 缓动函数 */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================
   Reset
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: hidden;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 全局装饰背景：等高线网格 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(139, 151, 173, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 151, 173, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -2;
}

/* 噪点纹理 */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: -1;
    mix-blend-mode: overlay;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

img, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* ============================================
   通用容器
   ============================================ */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Top Bar
   ============================================ */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 101;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.topbar-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
}

.topbar-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-right a {
    color: var(--text-secondary);
    font-size: 12px;
}

.topbar-right a:hover {
    color: var(--accent);
}

/* ============================================
   Header / Navigation
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s var(--ease);
}

.header.scrolled {
    background: rgba(10, 14, 26, 0.95);
    border-bottom-color: var(--border-accent);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.logo-mark {
    width: 32px;
    height: 32px;
    position: relative;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 800;
    font-size: 16px;
    transform: skewX(-10deg);
    box-shadow: 0 0 24px var(--accent-glow);
}

.logo-mark span {
    transform: skewX(10deg);
    font-family: var(--font-mono);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-text strong {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.logo-text small {
    font-size: 9px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.2em;
    margin-top: 2px;
}

/* Nav */
.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.nav a {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    transition: color 0.2s var(--ease);
}

.nav a:hover {
    color: var(--text-primary);
}

.nav a.active {
    color: var(--accent);
}

.nav a.active::after {
    content: "";
    position: absolute;
    bottom: -22px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* Header CTA */
.header-cta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-switch {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 10px;
    border: 1px solid var(--border);
    transition: all 0.2s var(--ease);
}

.lang-switch:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    position: relative;
}

.menu-toggle span {
    position: absolute;
    left: 8px;
    right: 8px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s var(--ease);
}

.menu-toggle span:nth-child(1) { top: 12px; }
.menu-toggle span:nth-child(2) { top: 17px; }
.menu-toggle span:nth-child(3) { top: 22px; }

.menu-toggle.active span:nth-child(1) {
    top: 17px;
    transform: rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    top: 17px;
    transform: rotate(-45deg);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 0 0 transparent, inset 0 0 0 transparent;
}

.btn-primary:hover {
    background: #4ff5ff;
    box-shadow: 0 8px 24px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow-soft);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 13px;
}

.btn-ghost:hover {
    color: var(--accent);
}

.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 12px; }
.btn-lg { padding: 16px 32px; font-size: 15px; }

.btn-arrow::after {
    content: "→";
    transition: transform 0.2s var(--ease);
}

.btn-arrow:hover::after {
    transform: translateX(4px);
}

/* ============================================
   Section Headers
   ============================================ */
.section {
    padding: 80px 0;
    position: relative;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 16px;
    padding: 6px 12px;
    border: 1px solid var(--border-accent);
    background: var(--accent-glow-soft);
}

.section-tag::before {
    content: "//";
    color: var(--text-muted);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-title em {
    font-style: normal;
    color: var(--accent);
    font-weight: 600;
}

.section-sub {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 640px;
    line-height: 1.7;
}

.section-head {
    margin-bottom: 56px;
}

.section-head.center {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.section-head.center .section-sub {
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Animations
   ============================================ */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 var(--accent-glow); }
    70% { box-shadow: 0 0 0 16px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes drawLine {
    from { stroke-dashoffset: 100%; }
    to { stroke-dashoffset: 0; }
}

@keyframes nodeBlink {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* 滚动入场动画 */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 64px 0 32px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    margin-top: 16px;
    max-width: 320px;
}

.footer-col h4 {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 20px;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul a {
    color: var(--text-secondary);
    font-size: 13px;
    transition: color 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-col ul a:hover {
    color: var(--accent);
}

.footer-col ul a::before {
    content: "›";
    color: var(--text-muted);
    transition: color 0.2s var(--ease);
}

.footer-col ul a:hover::before {
    color: var(--accent);
}

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-muted);
    font-size: 12px;
    font-family: var(--font-mono);
}

.footer-bottom-links {
    display: flex;
    gap: 24px;
}

.footer-bottom a {
    color: var(--text-muted);
}

.footer-bottom a:hover {
    color: var(--accent);
}

/* ============================================
   Cards / Surfaces
   ============================================ */
.surface {
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    padding: 24px;
    position: relative;
    transition: all 0.3s var(--ease);
}

.surface:hover {
    border-color: var(--border-accent);
    background: rgba(22, 28, 48, 0.8);
}

.surface-corner::before,
.surface-corner::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--accent);
    transition: all 0.3s var(--ease);
}

.surface-corner::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid;
    border-left: 2px solid;
}

.surface-corner::after {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid;
    border-right: 2px solid;
}

/* ============================================
   Utility
   ============================================ */
.text-accent { color: var(--accent); }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
    margin: 32px 0;
}

.glow-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================
   Responsive - Mobile First
   ============================================ */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    .nav { gap: 0; }
    .nav a { padding: 8px 10px; font-size: 13px; }
}

@media (max-width: 768px) {
    :root {
        --header-h: 56px;
    }

    .topbar { display: none; }
    .nav, .header-cta .lang-switch { display: none; }
    .menu-toggle { display: block; }

    .section { padding: 56px 0; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* 移动端导航抽屉 */
    .nav-mobile {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--bg-overlay);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s var(--ease);
        z-index: 99;
    }

    .nav-mobile.open {
        max-height: 80vh;
    }

    .nav-mobile a {
        display: block;
        padding: 16px 24px;
        color: var(--text-secondary);
        font-size: 15px;
        border-bottom: 1px solid var(--border);
    }

    .nav-mobile a:last-child {
        border-bottom: none;
        color: var(--accent);
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .container, .container-wide { padding: 0 16px; }
    .section-title { font-size: 28px; }
}