/* ========================================
   AI Hub - 主样式表
   设计风格: 科技未来感 + 深色主题
   ======================================== */

/* CSS变量定义 */
:root {
    /* 主色调 - 赛博朋克紫青配色 */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #06b6d4;
    --secondary-light: #22d3ee;
    --accent: #f472b6;
    --accent-gold: #fbbf24;

    /* 背景色 */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #222230;
    --bg-glass: rgba(26, 26, 37, 0.8);

    /* 文字色 */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    /* 边框 */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.3);

    /* 字体 */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Noto Sans SC', sans-serif;

    /* 间距 */
    --section-gap: 120px;
    --container-padding: 24px;

    /* 动画 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

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

/* ========================================
   动态背景
   ======================================== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.sphere-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.sphere-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation-delay: -7s;
}

.sphere-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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: 50px 50px;
    pointer-events: none;
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px var(--container-padding);
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.logo-text {
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

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

.update-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

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

/* ========================================
   主内容区
   ======================================== */
.main-container {
    padding-top: 80px;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px var(--container-padding);
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin-bottom: 60px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 100px;
    font-size: 0.85rem;
    color: #22c55e;
    margin-bottom: 32px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
}

.title-line {
    display: block;
}

.title-line.highlight {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.hero-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px 40px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ========================================
   Section 通用样式
   ======================================== */
.section {
    padding: var(--section-gap) var(--container-padding);
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.section-icon {
    font-size: 1.75rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
}

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

/* ========================================
   下载热度排名
   ======================================== */
.ranking-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
}

.ranking-list {
    display: flex;
    flex-direction: column;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: var(--bg-card-hover);
}

.ranking-item.top-3 {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
}

.rank-number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: 12px;
    flex-shrink: 0;
}

.rank-number.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
}

.rank-number.silver {
    background: linear-gradient(135deg, #e5e7eb, #9ca3af);
    color: #000;
}

.rank-number.bronze {
    background: linear-gradient(135deg, #fdba74, #ea580c);
    color: #000;
}

.rank-number.normal {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* 新应用排名特殊样式 */
.new-apps-container {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.new-app-item {
    position: relative;
}

.new-app-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--primary));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.new-app-item:hover::before {
    opacity: 1;
}

.new-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.app-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.app-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.app-details p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.app-category {
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--primary-light);
    font-weight: 500;
}

.app-stats {
    text-align: right;
}

.download-count {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.download-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 4px;
}

.trend.up {
    color: #22c55e;
}

.trend.down {
    color: #ef4444;
}

/* ========================================
   盈利能力榜单
   ======================================== */
.revenue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.revenue-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    transition: all var(--transition-normal);
}

.revenue-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
}

.revenue-card.featured {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    border-color: var(--primary);
}

.revenue-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.revenue-rank {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
    color: #000;
}

.revenue-app-info h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.revenue-app-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.revenue-amount {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 16px;
    margin-bottom: 20px;
}

.revenue-amount .amount {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold), #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.revenue-amount .period {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.revenue-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.metric {
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.metric-value {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   热点资讯
   ======================================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

.news-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.news-tag {
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--primary-light);
    font-weight: 500;
}

.news-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.news-source {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.source-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--bg-secondary);
}

.read-more {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap var(--transition-fast);
}

.read-more:hover {
    gap: 8px;
}

/* ========================================
   页脚
   ======================================== */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 40px var(--container-padding);
    margin-top: 60px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
    }

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

    .stat-card {
        width: 100%;
        max-width: 280px;
    }

    .ranking-item {
        flex-wrap: wrap;
        gap: 12px;
    }

    .app-stats {
        width: 100%;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 12px;
    }

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

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

/* ========================================
   加载动画
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-card-hover);
}
