/* ================================================================
   编程语言全景指南 · 全局样式
   ================================================================ */

/* ----- 全局重置 & 变量 ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f0f4f9;
    --card-bg: #ffffff;
    --text-primary: #0b1a33;
    --text-secondary: #334e68;
    --border: #d9e2ec;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    --radius: 24px;
    --transition: 0.25s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--bg);
    font-family: var(--font);
    color: var(--text-primary);
    padding: 2rem 1.5rem;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ----- 顶部双栏：统计 + 学习路径入口 ----- */
.top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.top-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.2rem 1.8rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color var(--transition), box-shadow var(--transition);
    text-decoration: none;
    color: inherit;
}

.top-card:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.08);
}

.top-card .left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.top-card .left .label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.top-card .left .main-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.top-card .left .main-text strong {
    color: #2563eb;
}

.top-card .right-arrow {
    font-size: 1.4rem;
    color: #94a3b8;
    transition: transform var(--transition), color var(--transition);
    flex-shrink: 0;
}

.top-card:hover .right-arrow {
    transform: translateX(4px);
    color: #2563eb;
}

.top-card.path-entry .left .main-text {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.top-card.path-entry .left .main-text .badge {
    font-size: 0.6rem;
    font-weight: 600;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    padding: 0.1rem 0.6rem;
    border-radius: 30px;
    letter-spacing: 0.02em;
}

/* 响应式：小屏变单列 */
@media (max-width: 768px) {
    .top-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .top-card {
        padding: 0.9rem 1.2rem;
    }

    .top-card .left .main-text {
        font-size: 0.95rem;
    }
}

/* ----- 头部（原 header） ----- */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #1a365d, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header .sub {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 1000px;
    margin: 0.4rem auto 0;
}

        /* 新增：深度搜索按钮样式 */
        .search-deep-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.3rem 1rem;
            background: #eef2f6;
            color: var(--text-secondary);
            border-radius: 30px;
            font-size: 0.8rem;
            font-weight: 500;
            text-decoration: none;
            transition: background 0.2s, color 0.2s, transform 0.2s;
            border: 1px solid transparent;
            white-space: nowrap;
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .search-deep-btn:hover {
            background: #2563eb;
            color: #fff;
            border-color: #2563eb;
            transform: scale(1.02);
        }
        .search-deep-btn.has-query {
            background: #dbeafe;
            color: #1d4ed8;
            border-color: #2563eb;
        }
        .search-deep-btn.has-query:hover {
            background: #2563eb;
            color: #fff;
        }
        @media (max-width: 768px) {
            .search-deep-btn {
                font-size: 0.7rem;
                padding: 0.2rem 0.8rem;
                max-width: 150px;
            }
        }


/* ----- 搜索框 ----- */
.search-bar {
    background: var(--card-bg);
    border-radius: 60px;
    padding: 0.5rem 1.5rem 0.5rem 2rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-bar:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.search-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
}

.search-icon {
    font-size: 1.2rem;
    margin-right: 0.8rem;
    color: #94a3b8;
}

.search-wrapper input {
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.6rem 0;
    flex: 1;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font);
    min-width: 120px;
}

.search-wrapper input::placeholder {
    color: #94a3b8;
}

.search-clear {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 0.5rem;
    transition: color var(--transition);
}

.search-clear:hover {
    color: var(--text-primary);
}

.search-info {
    font-size: 0.85rem;
    color: #94a3b8;
    white-space: nowrap;
    display: flex;
    gap: 0.8rem;
}

.search-info strong {
    color: var(--text-primary);
}

.search-info #resultStats {
    color: #2563eb;
    font-weight: 500;
}

@media (max-width: 768px) {
    .search-bar {
        flex-direction: column;
        align-items: stretch;
        border-radius: 24px;
        padding: 0.8rem 1.2rem;
    }

    .search-wrapper {
        min-width: unset;
    }

    .search-info {
        justify-content: space-between;
    }
}

/* ----- 图例 ----- */
.legend-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.8rem;
    background: var(--card-bg);
    padding: 0.6rem 2rem;
    border-radius: 60px;
    border: 1px solid var(--border);
    margin-bottom: 2.8rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.legend-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 6px;
    margin-right: 4px;
}

.legend-dot.ai { background: #7c3aed; }
.legend-dot.web { background: #0ea5e9; }
.legend-dot.sys { background: #f59e0b; }
.legend-dot.mobile { background: #10b981; }
.legend-dot.data { background: #ef4444; }
.legend-dot.general { background: #2563eb; }
.legend-dot.special { background: #ec4899; }
.legend-dot.db { background: #f97316; }
.legend-dot.server { background: #06b6d4; }
.legend-dot.tool { background: #8b5cf6; }
.legend-dot.os { background: #f43f5e; }

/* ----- 卡片网格 ----- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem;
    margin-bottom: 4rem;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.10);
    border-color: #2563eb;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.4rem;
}

.card-name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.card-badge {
    font-size: 0.7rem;
    font-weight: 600;
    background: #eef2f6;
    padding: 0.15rem 0.8rem;
    border-radius: 30px;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-top: 0.25rem;
}

.card-tagline {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2563eb;
    margin: 0.2rem 0 0.5rem;
}

.card-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    flex: 1;
    margin-bottom: 0.8rem;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.5rem;
    margin-bottom: 0.8rem;
}

.card-meta span {
    background: #f1f5f9;
    font-size: 0.7rem;
    padding: 0.15rem 0.8rem;
    border-radius: 30px;
    color: var(--text-secondary);
}

.card-best {
    background: #f0f7ff;
    border-left: 4px solid #2563eb;
    padding: 0.5rem 0.8rem;
    border-radius: 12px;
    font-size: 0.82rem;
    color: #1e3a5f;
    margin-bottom: 0.9rem;
}

.card-best strong {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #2563eb;
}

.card-hint {
    text-align: right;
    font-size: 0.7rem;
    color: #94a3b8;
    border-top: 1px dashed #e9edf4;
    padding-top: 0.5rem;
}

.card-hint span {
    background: #eef2f6;
    padding: 0.1rem 0.8rem;
    border-radius: 30px;
    font-size: 0.65rem;
    color: #64748b;
}

/* ----- 评分条 ----- */
.score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem 1rem;
    border-top: 1px solid #e9edf4;
    padding-top: 0.7rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.score-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
}

.score-item .label {
    min-width: 28px;
}

.bar {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    min-width: 40px;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    background: #2563eb;
}

.bar-fill.gold { background: #f59e0b; }
.bar-fill.green { background: #10b981; }
.bar-fill.purple { background: #7c3aed; }
.bar-fill.red { background: #ef4444; }
.bar-fill.sky { background: #0ea5e9; }
.bar-fill.pink { background: #ec4899; }
.bar-fill.orange { background: #f97316; }
.bar-fill.teal { background: #06b6d4; }
.bar-fill.rose { background: #f43f5e; }

.no-result {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #94a3b8;
    font-size: 1.1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: none;
}

.no-result strong {
    color: var(--text-primary);
}

/* ----- 对比区（保留原样，篇幅考虑此处简写） ----- */
.compare-section {
    background: var(--card-bg);
    border-radius: 36px;
    padding: 2.2rem 2.2rem 2.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 2.5rem;
}

.compare-section h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.compare-section h2 small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.8rem;
    margin-top: 1.5rem;
}

.compare-col {
    background: #fafcff;
    border-radius: 20px;
    padding: 1.2rem 1.5rem 1.5rem;
    border: 1px solid #eef3f9;
}

.compare-col h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e9edf4;
    padding-bottom: 0.5rem;
}

.compare-item {
    display: flex;
    gap: 0.6rem;
    padding: 0.3rem 0;
    border-bottom: 1px dashed #e9edf4;
    font-size: 0.9rem;
}

.compare-item:last-child {
    border-bottom: 0;
}

.compare-item .lang {
    font-weight: 600;
    min-width: 70px;
    color: #0b1a33;
}

.compare-item .desc {
    color: var(--text-secondary);
}

.compare-item .highlight {
    color: #2563eb;
    font-weight: 600;
}

/* ----- 决策引导 ----- */
.decision-box {
    background: linear-gradient(135deg, #0b1a33, #1a365d);
    border-radius: 40px;
    padding: 2rem 2.5rem;
    color: white;
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.2rem;
}

.decision-box .text {
    font-size: 1.1rem;
    max-width: 540px;
}

.decision-box .text strong {
    color: #fcd34d;
}

.decision-box .pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.3rem 1.2rem;
    border-radius: 60px;
    font-size: 0.85rem;
    color: #e2e8f0;
    transition: 0.15s;
}

.pill:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
    cursor: default;
}

/* ----- 底部 ----- */
.footer {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-top: 2.5rem;
    text-align: center;
}

.footer .contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.8rem;
}

.footer .contact a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.footer .contact a:hover {
    color: #2563eb;
}

.footer .copyright {
    font-size: 0.85rem;
    color: #94a3b8;
}

.footer .sitemap-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #2563eb;
    text-decoration: none;
}

.footer .sitemap-link:hover {
    text-decoration: underline;
}

/* ----- 返回顶部 ----- */
.back-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2563eb;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s, background 0.2s;
    z-index: 999;
}

.back-top:hover {
    transform: scale(1.08);
    background: #1d4ed8;
}

/* ----- 响应式 ----- */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

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

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

    .decision-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .compare-section {
        padding: 1.2rem;
    }

    .back-top {
        bottom: 1rem;
        right: 1rem;
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}