/* Neurova 官网样式 - 增强响应式版本 */

/* CSS变量 */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --accent: #10b981;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --text-primary: #1f2937;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.3s ease;
    --header-height: 4rem;
    --sidebar-width: 280px;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background: var(--bg-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
    overflow: hidden;
}

body.sidebar-open {
    overflow: hidden;
}

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

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========== 头部导航 ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 210px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    border-radius: var(--radius-md);
}

.logo:hover .logo-icon {
    opacity: 0.9;
}

.logo-img {
    width: 210px;
    height: 50px;
    object-fit: contain;
    border-radius: 0;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
}

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

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

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

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--bg-light);
}

.mobile-menu-toggle span {
    display: block;
    width: 1.5rem;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
    border-radius: 1px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========== 移动端侧边栏导航 ========== */

/* 侧边栏遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* 侧边栏 */
.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: white;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-nav.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}

.sidebar-logo {
    display: flex;
    align-items: center;
}

.sidebar-logo .logo-img,
.sidebar-logo .logo-icon {
    width: 150px;
    height: 36px;
}

.sidebar-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: var(--transition);
}

.sidebar-close:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.sidebar-close svg {
    width: 1.5rem;
    height: 1.5rem;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.sidebar-menu a:hover {
    background: var(--bg-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-menu a.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), transparent);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-menu a svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* 主内容区域 */
.main {
    min-height: calc(100vh - var(--header-height));
    padding-top: var(--header-height);
}

/* ========== Hero区域 ========== */
.hero {
    position: relative;
    min-height: 100vh;
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--bg-light) 0%, #dbeafe 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.splash-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========== 按钮样式 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--primary);
}

/* ========== 特性区域 ========== */
.features {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--card-color, var(--primary));
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.features-grid .feature-card:nth-child(1) .feature-icon { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.features-grid .feature-card:nth-child(2) .feature-icon { background: linear-gradient(135deg, #059669, #10b981); }
.features-grid .feature-card:nth-child(3) .feature-icon { background: linear-gradient(135deg, #d97706, #f59e0b); }
.features-grid .feature-card:nth-child(4) .feature-icon { background: linear-gradient(135deg, #dc2626, #ef4444); }
.features-grid .feature-card:nth-child(5) .feature-icon { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.features-grid .feature-card:nth-child(6) .feature-icon { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.features-grid .feature-card:nth-child(7) .feature-icon { background: linear-gradient(135deg, #ec4899, #f472b6); }
.features-grid .feature-card:nth-child(8) .feature-icon { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }
.features-grid .feature-card:nth-child(9) .feature-icon { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.features-grid .feature-card:nth-child(10) .feature-icon { background: linear-gradient(135deg, #6366f1, #818cf8); }
.features-grid .feature-card:nth-child(11) .feature-icon { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.features-grid .feature-card:nth-child(12) .feature-icon { background: linear-gradient(135deg, #06b6d4, #22d3ee); }

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    white-space: nowrap;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========== 版本列表 ========== */
.releases-section {
    padding: 5rem 0;
    background: var(--bg-light);
}

.releases-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.release-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.release-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.release-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.release-version {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.release-date {
    font-size: 0.875rem;
    color: var(--text-light);
}

.release-title {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.release-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    margin-left: 0.5rem;
}

.release-content {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.release-content.active {
    display: block;
}

.release-content h4 {
    font-size: 0.95rem;
    margin: 1rem 0 0.5rem;
}

.release-content ul {
    padding-left: 1.5rem;
}

.release-content li {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.release-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-top: 0.5rem;
    transition: var(--transition);
}

.release-toggle:hover {
    color: var(--primary);
}

/* ========== 文档区域 ========== */
.docs-section {
    padding: 5rem 0;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
}

.doc-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.doc-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.doc-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.doc-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.doc-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ========== 页脚 ========== */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.footer-logo .logo-icon {
    width: 2rem;
    height: 2rem;
}

.footer-desc {
    color: var(--text-light);
    font-size: 0.95rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section a {
    color: var(--text-light);
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* ========== 响应式断点 ========== */

/* 超大屏幕 (1400px+) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* 大屏幕 (1200px - 1399px) */
@media (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
}

/* 中大屏幕 (992px - 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* 平板 (768px - 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .logo-img,
    .logo-icon {
        width: 150px;
        height: 36px;
    }

    .nav-menu {
        display: none;
    }

    .sidebar-overlay {
        display: none;
    }

    .sidebar-nav {
        display: flex;
    }

    .hero {
        padding: 5rem 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .features,
    .releases-section,
    .docs-section {
        padding: 4rem 0;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机 (576px - 767px) */
@media (max-width: 767px) {
    :root {
        --header-height: 3.5rem;
        --sidebar-width: 260px;
    }

    .logo-img,
    .logo-icon {
        width: 130px;
        height: 32px;
    }

    .container {
        max-width: 100%;
        padding: 0 1rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .features,
    .releases-section,
    .docs-section {
        padding: 3rem 0;
    }

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

    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

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

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

    .feature-card,
    .doc-card,
    .release-card {
        padding: 1.25rem;
    }

    .release-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section h4 {
        margin-bottom: 0.75rem;
    }
}

/* 小手机 (575px以下) */
@media (max-width: 575px) {
    .hero {
        padding: 2.5rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-buttons {
        gap: 0.75rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-icon {
        width: 2.5rem;
        height: 2.5rem;
        margin-bottom: 1rem;
    }

    .feature-title {
        font-size: 1.1rem;
    }

    .feature-desc {
        font-size: 0.9rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .feature-card:hover,
    .doc-card:hover,
    .release-card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    .btn-primary:hover {
        background: var(--primary);
    }

    .btn-secondary:hover {
        background: white;
    }

    a:hover {
        color: var(--primary);
    }
}

/* 暗黑模式支持 (可选) */
@media (prefers-color-scheme: dark) {
    :root {
        /* 可以添加暗黑模式变量 */
    }
}

/* 减少动画 (无障碍) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* 打印样式 */
@media print {
    .header,
    .footer,
    .mobile-menu-toggle,
    .sidebar-nav,
    .sidebar-overlay {
        display: none !important;
    }

    .main {
        padding-top: 0;
    }
}

/* 安全区域适配 (iPhone刘海屏) */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: env(safe-area-inset-top);
    }

    .main {
        padding-top: calc(var(--header-height) + env(safe-area-inset-top));
    }

    .sidebar-nav {
        padding-top: env(safe-area-inset-top);
    }
}
