/* ===== 暗黑赛博朋克主题 ===== */

/* ===== View Transitions API ===== */

/* Alpine.js x-cloak - hide until initialized */
[x-cloak] { display: none !important; }

@view-transition {
    navigation: auto;
}

/* Single clean crossfade — no blur, no scale, no slide */
::view-transition-old(root) {
    animation: vt-out 0.3s ease;
}

::view-transition-new(root) {
    animation: vt-in 0.3s ease;
}

/* Nav stays stable */
nav {
    view-transition-name: none;
}

@keyframes vt-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes vt-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Fallback for browsers without View Transitions */
@supports not (view-transition-name: root) {
    main {
        animation: fadeInUp 0.4s ease;
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

:root {
    /* === Platinum Edge Palette === */
    --accent-500: #38bdf8;
    --accent-600: #0ea5e9;
    --accent-glow: rgba(56, 189, 248, 0.15);

    /* Surfaces */
    --bg-base: #0f172a;
    --bg-surface: #1e293b;
    --bg-elevated: #273548;

    /* Borders */
    --border-subtle: rgba(51, 65, 85, 0.6);
    --border-accent: rgba(56, 189, 248, 0.3);
    --border-accent-hover: rgba(56, 189, 248, 0.5);

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Legacy aliases */
    --cyan-500: #38bdf8;
    --cyan-600: #0ea5e9;
}

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

body {
    font-family: 'Noto Sans SC', 'Rajdhani', sans-serif;
    background-color: #0f172a;
    color: #ffffff;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', 'Noto Sans SC', sans-serif;
}

/* Particles背景 */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, #0f172a 0%, #0f172a 50%, #0f172a 100%);
}

/* ===== 极光背景 Hero ===== */
.aurora-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.aurora-bg::before,
.aurora-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
    animation: auroraFloat 8s ease-in-out infinite alternate;
}

.aurora-bg::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
    top: -200px;
    left: -100px;
}

.aurora-bg::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -4s;
}

.aurora-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
}

.aurora-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #38bdf8 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: auroraFloat 10s ease-in-out infinite alternate-reverse;
}

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

/* ===== 发光卡片悬停效果 (Apple-style subtle) ===== */
.glow-card {
    position: relative;
    overflow: hidden;
}

.glow-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.05));
    border-radius: 17px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 导航 */
.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #38bdf8;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #38bdf8;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 卡片 — Apple-style subtle lift */
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.glass-card::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    pointer-events: none;
}
.glass-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.08), 0 0 0 1px rgba(56, 189, 248, 0.1);
}

/* 霓虹边框 */
.neon-border {
    box-shadow: 0 0 12px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-accent);
}

/* 渐变按钮 */
.gradient-btn {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    border: none;
    color: white;
    padding: 14px 36px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.gradient-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.gradient-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* 打字机 */
.typewriter {
    display: inline-block;
    border-right: 2px solid #38bdf8;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { border-color: transparent; }
    50% { border-color: #38bdf8; }
}

/* 脉冲 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 浮动 */
.float {
    animation: float 3s ease-in-out infinite;
}

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

/* 网格背景 */
.grid-bg {
    background-image: 
        linear-gradient(rgba(56, 189, 248, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, #38bdf8, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #38bdf8, #38bdf8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0ea5e9, #0ea5e9);
}

/* 代码块 */
.code-block {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px;
    padding: 16px;
    font-family: 'Fira Code', 'Courier New', monospace;
    overflow-x: auto;
}

/* 响应式 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.25rem;
    }
}

/* ===== 滚动渐入动画 (Apple-style subtle) ===== */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* 交错延迟 */
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* ===== 数字计数动画 ===== */
.counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ===== 进入动画 ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Hero浮动 */
@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-float {
    animation: heroFloat 6s ease-in-out infinite;
}

/* 霓虹脉冲 */
@keyframes neonPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(56, 189, 248, 0.5), 0 0 20px rgba(56, 189, 248, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(56, 189, 248, 0.8), 0 0 40px rgba(56, 189, 248, 0.5);
    }
}

.neon-pulse {
    animation: neonPulse 2s ease-in-out infinite;
}

/* ===== 打字机多行切换 ===== */



/* ===== 滚动进度条 ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8, #38bdf8, #38bdf8);
    z-index: 100;
    transition: width 0.1s ease;
}

/* ===== 聊天演示Widget ===== */
.chat-widget {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.chat-bubble-user {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px 16px 4px 16px;
    padding: 10px 14px;
    max-width: 75%;
    margin-left: auto;
}

.chat-bubble-bot {
    background: rgba(55, 65, 81, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 16px 16px 16px 4px;
    padding: 10px 14px;
    max-width: 80%;
}

@keyframes chatFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg {
    animation: chatFadeIn 0.4s ease-out forwards;
    opacity: 0;
}

/* 打字指示器 */
.typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    margin: 0 2px;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-6px); opacity: 1; }
}

/* ===== 科技感扫描线 ===== */
.scanline {
    position: relative;
    overflow: hidden;
}

.scanline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), transparent);
    animation: scanline 4s linear infinite;
}

@keyframes scanline {
    0% { top: 0; }
    100% { top: 100%; }
}

/* ===== 博客文章正文样式 ===== */

.blog-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #d1d5db;
}

.blog-content h1 {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #f3f4f6;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(56, 189, 248, 0.3);
}

.blog-content h2 {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #e5e7eb;
    margin: 2rem 0 0.8rem;
    padding-left: 0.8rem;
    border-left: 4px solid #38bdf8;
}

.blog-content h3 {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #d1d5db;
    margin: 1.5rem 0 0.6rem;
}

.blog-content p {
    margin: 0.8rem 0;
}

.blog-content ul, .blog-content ol {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
}

.blog-content li {
    margin: 0.3rem 0;
}

.blog-content strong {
    color: #38bdf8;
    font-weight: 600;
}

.blog-content code {
    background: rgba(56, 189, 248, 0.15);
    color: #e2e8f0;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.blog-content pre {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    padding: 1.2rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.blog-content pre code {
    background: none;
    padding: 0;
    color: #99f6e4;
    font-size: 0.88rem;
    line-height: 1.6;
}

.blog-content blockquote {
    border-left: 4px solid #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    color: #e2e8f0;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.blog-content th {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    padding: 0.8rem;
    text-align: left;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-family: 'Noto Sans SC', sans-serif;
}

.blog-content td {
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.blog-content tr:hover td {
    background: rgba(56, 189, 248, 0.05);
}

.blog-content a {
    color: #7dd3fc;
    text-decoration: none;
    border-bottom: 1px solid rgba(125, 211, 252, 0.3);
    transition: all 0.2s;
}

.blog-content a:hover {
    color: #e2e8f0;
    border-bottom-color: #e2e8f0;
}

.blog-content hr {
    border: none;
    border-top: 1px solid rgba(56, 189, 248, 0.2);
    margin: 2rem 0;
}

.blog-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}

/* ===== 解决方案详情页样式 ===== */

.solution-content .arch-diagram {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.solution-content .arch-diagram svg {
    max-width: 100%;
    height: auto;
}

.solution-content .feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.solution-content .feature-card {
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.solution-content .feature-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.08);
    transform: translateY(-2px);
}

.solution-content .highlight-box {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(56, 189, 248, 0.1));
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
}

.solution-content .stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.solution-content .stat-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.15);
}

.solution-content .stat-item .stat-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #38bdf8, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.solution-content .stat-item .stat-label {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}


/* ===== Scroll-driven Animations ===== */

/* Scroll progress bar - linked to scroll position */
.scroll-progress {
    animation: grow-progress linear;
    animation-timeline: scroll();
}

@keyframes grow-progress {
    from { width: 0%; }
    to { width: 100%; }
}

/* Parallax effect for hero sections */
.hero-parallax {
    animation: parallax linear;
    animation-timeline: scroll();
    animation-range: 0vh 100vh;
}

@keyframes parallax {
    from { transform: translateY(0); }
    to { transform: translateY(-100px); }
}

/* Fade in on scroll */
.scroll-fade-in {
    animation: scrollFadeIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
}

@keyframes scrollFadeIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale in on scroll */
.scroll-scale-in {
    animation: scrollScaleIn linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
}

@keyframes scrollScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide in from left on scroll */
.scroll-slide-left {
    animation: scrollSlideLeft linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
}

@keyframes scrollSlideLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide in from right on scroll */
.scroll-slide-right {
    animation: scrollSlideRight linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
}

@keyframes scrollSlideRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Rotate on scroll */
.scroll-rotate {
    animation: scrollRotate linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 50%;
}

@keyframes scrollRotate {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* Fallback for browsers without scroll-driven animations */
@supports not (animation-timeline: scroll()) {
    .scroll-progress {
        transition: width 0.1s ease;
    }
    
    .scroll-fade-in,
    .scroll-scale-in,
    .scroll-slide-left,
    .scroll-slide-right,
    .scroll-rotate {
        /* Use IntersectionObserver fallback via JS */
    }
}