/* ============================================================
   practice-nav.css — AI 实操项目页统一导航样式
   提取自主站 style.css 的 .site-header 部分，保证与首页导航视觉一致。
   引入顺序：本文件在前，页面内联 <style> 在后（内容样式仅作用于正文）。
   ============================================================ */

/* 导航所需的主站变量（与 style.css :root 一致的子集） */
.practice-nav-scope {
    --surface: rgba(15, 23, 42, 0.65);
    --text: #f8fafc;
    --border: rgba(56, 189, 248, 0.18);
    --border-strong: rgba(56, 189, 248, 0.35);
    --cyan: #00f0ff;
    --cyan-glow: rgba(0, 240, 255, 0.4);
    --purple: #a855f7;
}

/* 与主站一致的导航容器宽度（覆盖页面内联的窄版 .container） */
.site-header .container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Site header（与 style.css 267-341 行一致） */
.site-header {
    background: var(--surface, rgba(15, 23, 42, 0.65));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border, rgba(56, 189, 248, 0.18));
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text, #f8fafc);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand .logo-img {
    width: auto;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    box-shadow: 0 0 15px var(--cyan-glow, rgba(0, 240, 255, 0.4));
}

.brand-text {
    background: linear-gradient(90deg, var(--cyan, #00f0ff), var(--purple, #a855f7));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.main-nav a {
    padding: 9px 20px;
    border-radius: 24px;
    color: var(--text-secondary, #94a3b8);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.25s;
    border: 1px solid transparent;
    text-decoration: none;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--cyan, #00f0ff);
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--border-strong, rgba(56, 189, 248, 0.35));
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.12);
}

/* ---- 移动端（与 style.css 900/768/500 断点 header 部分一致） ---- */
@media (max-width: 900px) {
    .header-inner {
        flex-wrap: nowrap;
        flex-direction: column;
        height: auto;
        padding: 14px 16px;
        gap: 10px;
        align-items: stretch;
        position: relative;
    }

    .brand {
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }

    .brand .logo-img {
        height: 36px;
    }

    .brand-text {
        font-size: 18px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding: 4px 0;
        gap: 6px;
        border: none;
    }

    .main-nav a {
        padding: 7px 14px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 10px 14px;
        gap: 8px;
        position: relative;
    }

    .brand .logo-img {
        width: 24px;
        height: 24px;
    }

    .brand-text {
        font-size: 16px;
    }

    .main-nav {
        gap: 4px;
        padding: 2px 0;
        justify-content: center;
    }

    .main-nav a {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 500px) {
    .header-inner {
        padding: 8px 12px;
        gap: 8px;
    }

    .brand .logo-img {
        width: 22px;
        height: 22px;
    }

    .brand-text {
        font-size: 15px;
    }

    .main-nav {
        gap: 3px;
    }

    .main-nav a {
        padding: 5px 10px;
        font-size: 12px;
    }
}
