/* 前端技术生态导航 - 样式表 */

/* ============================================
   设计理念：
   - 深色主题，减少视觉疲劳
   - 每个技术类别有独特的强调色
   - 非对称网格布局，打破常规
   - 大胆的字体排版，使用Space Grotesk
   - 微妙的动画和悬停效果
   - 响应式设计，适配所有设备
   ============================================ */

/* 基础重置与变量 */
:root {
    /* 主色调 */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-card-hover: #1a1a1a;
    
    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #858585;
    
    /* 类别强调色 */
    --color-basic: #3b82f6;      /* 基础核心 - 蓝色 */
    --color-framework: #10b981;   /* 框架生态 - 绿色 */
    --color-engineering: #f59e0b; /* 工程化 - 琥珀色 */
    --color-visualization: #a78bfa; /* 可视化 - 紫色 */
    --color-crossplatform: #ec4899; /* 跨平台 - 粉色 */
    --color-ai: #06b6d4;         /* AI与智能 - 青色 */
    --color-advanced: #f97316;   /* 前沿技术 - 橙色 */
    --color-default: #6b7280;    /* 默认 - 灰色 */
    
    /* 间距与尺寸 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 阴影 */
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: #2563eb;
    color: white;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform var(--transition-fast);
}

.skip-link:focus {
    transform: translateY(0);
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-title {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--color-basic) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* 搜索框 */
.search-container {
    max-width: 600px;
    margin: 0 auto 32px;
    display: flex;
    gap: 12px;
}

.search-input {
    flex: 1;
    padding: 16px 24px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: var(--transition-normal);
    outline: none;
}

.search-input:focus {
    border-color: var(--color-basic);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-button {
    padding: 16px 32px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-normal);
}

.search-button:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

/* 统计信息 */
.stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-divider {
    color: var(--text-muted);
}

/* 主要内容 */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* 分类导航 */
.category-nav {
    margin-bottom: 48px;
    position: sticky;
    top: 20px;
    z-index: 100;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    white-space: nowrap;
}

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

.filter-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* 技术网格 */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    align-items: start;
    gap: 24px;
    margin-bottom: 80px;
}

.results-summary {
    margin: -24px 0 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 48px 24px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-align: center;
}

/* ============================================
   学习路线导航
   ============================================ */
.roadmap-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 56px;
    padding: 14px 20px;
    background: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    position: sticky;
    top: 16px;
    z-index: 90;
}

.roadmap-label {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-right: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.roadmap-track {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0;
}

.roadmap-track::-webkit-scrollbar {
    display: none;
}

.roadmap-dot {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

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

.roadmap-dot .dot-index {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--dot-color, var(--text-muted));
}

.roadmap-dot:hover .dot-index {
    opacity: 1;
}

/* ============================================
   阶段容器与阶段区块（时间线/路线布局）
   ============================================ */
.stages-container {
    display: flex;
    flex-direction: column;
    gap: 56px;
    margin-bottom: 80px;
}

.stage-block {
    position: relative;
    padding-left: 88px;
}

/* 路线竖向连接线 */
.stage-block::before {
    content: '';
    position: absolute;
    left: 31px;
    top: 28px;
    bottom: -56px;
    width: 2px;
    background: linear-gradient(
        to bottom,
        var(--stage-color, rgba(255, 255, 255, 0.15)) 0%,
        rgba(255, 255, 255, 0.04) 100%
    );
}

.stage-block:last-child::before {
    display: none;
}

/* 路线节点（阶段编号圆点） */
.stage-node {
    position: absolute;
    left: 0;
    top: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--stage-color, var(--color-default));
    box-shadow: 0 0 0 6px var(--bg-primary), 0 0 24px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.stage-node-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--stage-color, var(--text-primary));
    line-height: 1;
}

.stage-node-label {
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
}

/* 阶段内容 */
.stage-content {
    min-width: 0;
}

.stage-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stage-title-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.stage-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
}

.stage-subtitle {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stage-color, var(--text-muted));
}

.stage-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 760px;
}

/* 阶段内卡片网格 */
.stage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    align-items: start;
    gap: 24px;
}

.stage-grid .empty-state {
    grid-column: 1 / -1;
}

/* 技术卡片 */
.tech-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-normal);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.tech-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color, var(--color-default));
    transition: var(--transition-normal);
}

.tech-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.1);
}

.tech-card:hover::before {
    width: 6px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.card-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--card-color, var(--color-default));
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.card-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.3;
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.5;
}

.card-techs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.tech-tag {
    display: inline-flex;
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.tech-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--card-color, var(--color-basic));
    text-decoration: none;
    transition: var(--transition-normal);
    margin-top: auto;
}

.card-link:hover {
    gap: 12px;
    color: var(--text-primary);
}

.card-link svg {
    width: 16px;
    height: 16px;
    transition: var(--transition-normal);
}

.card-link:hover svg {
    transform: translateX(4px);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: -0.03em;
}

/* 热门技术快速访问 */
.quick-access {
    margin-bottom: 60px;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.quick-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* 快速参考部分 */
.quick-reference {
    margin-bottom: 80px;
}

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

.reference-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-normal);
}

.reference-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.reference-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.reference-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 页脚 */
.footer {
    background: var(--bg-secondary);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

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

/* 响应式设计 */
@media (max-width: 1024px) {
    .site-title {
        font-size: 3rem;
    }

    .stage-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .header {
        padding: 60px 0 40px;
    }

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

    .site-subtitle {
        font-size: 1.1rem;
    }

    .search-container {
        flex-direction: column;
    }

    .search-button {
        width: 100%;
    }

    .stats {
        flex-direction: column;
        gap: 8px;
    }

    .stat-divider {
        display: none;
    }

    .category-nav {
        position: static;
        margin-bottom: 32px;
    }

    .category-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .filter-btn {
        flex-shrink: 0;
    }

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

    .quick-links {
        gap: 8px;
    }

    .quick-link {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

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

    /* 学习路线导航：移动端隐藏文字标签，仅保留编号 */
    .roadmap-nav {
        top: 12px;
        padding: 10px 14px;
    }

    .roadmap-dot {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    /* 阶段区块：缩小路线列 */
    .stage-block {
        padding-left: 68px;
    }

    .stage-block::before {
        left: 23px;
    }

    .stage-node {
        width: 48px;
        height: 48px;
    }

    .stage-node-number {
        font-size: 1.1rem;
    }

    .stage-node-label {
        display: none;
    }

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

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

    .stages-container {
        gap: 40px;
    }

    .stage-block::before {
        bottom: -40px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 2rem;
    }

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

    .tech-card {
        padding: 20px;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .roadmap-label {
        display: none;
    }
}

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

.tech-card {
    opacity: 0;
    transform: translateY(20px);
}

.tech-card.is-visible {
    animation: fadeInUp 0.5s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }

    .tech-card {
        opacity: 1;
        transform: none;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 选择样式 */
::selection {
    background: #2563eb;
    color: white;
}

/* 焦点样式 */
:focus-visible {
    outline: 2px solid var(--color-basic);
    outline-offset: 2px;
}
