/* 站点统一顶部导航（与首页 index.html 内联的 .lp-nav 系列样式保持一致）。
   首页的样式写在 index.html 的 <style> 里，其他页面（教学视频目录页 / 详情页）
   通过本文件复用同一套导航外观，避免各页面各写一份。

   用法：<body class="has-site-nav"> + {% include "includes/site_header.html" %} */

body.has-site-nav {
    /* 导航为 fixed，需要在页面顶部补出等高留白 */
    padding-top: 68px;
}

.lp-wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.lp-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    transition: background .25s ease, box-shadow .25s ease;
}
.lp-nav.is-scrolled {
    background: #fff;
    box-shadow: 0 8px 26px rgba(2, 6, 23, .10);
}
.lp-nav-inner { display: flex; align-items: center; gap: 22px; height: 68px; }
.lp-brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

/* 品牌 logo：原图是白底横幅（4096×1024，四周大量留白、右下角带水印），
   用固定尺寸容器 + 负偏移裁掉留白与水印，不做任何滤镜处理 */
.lp-logo-plate {
    display: block; position: relative; flex: 0 0 auto;
    width: 160px; height: 44px; border-radius: 11px;
    background: transparent; overflow: hidden;
}
.lp-logo-plate img {
    position: absolute; left: -94px; top: -23px;
    width: 348px; height: 87px; max-width: none;
}

.lp-nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; flex: 1 1 auto; }
.lp-nav-links a {
    color: #475569; font-size: 14px; font-weight: 500;
    padding: 8px 12px; border-radius: 8px; transition: .2s;
    white-space: nowrap;
}
.lp-nav-links a:hover { color: #059669; background: rgba(5, 150, 105, .08); }
/* 当前栏目高亮：只在教学视频等非首页出现 */
.lp-nav-links a.is-active { color: #059669; background: rgba(5, 150, 105, .10); }

/* 二级下拉：教学视频 → 教材同步课 / 试卷解析 */
.lp-nav-drop { position: relative; display: inline-flex; align-items: center; }
.lp-nav-drop > a::after { content: "▾"; margin-left: 5px; font-size: 10px; opacity: .55; }
.lp-nav-drop-menu {
    position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    min-width: 148px; padding: 6px; border-radius: 12px; background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 18px 40px -22px rgba(2, 6, 23, .45);
    display: grid; gap: 2px;
    opacity: 0; visibility: hidden; transition: opacity .16s ease, visibility .16s ease;
}
.lp-nav-drop:hover .lp-nav-drop-menu,
.lp-nav-drop:focus-within .lp-nav-drop-menu { opacity: 1; visibility: visible; }
.lp-nav-drop-menu a {
    display: block; color: #334155; font-size: 13.5px; font-weight: 500;
    padding: 9px 12px; border-radius: 8px; white-space: nowrap;
}
.lp-nav-drop-menu a:hover { color: #059669; background: #ecfdf5; }
.lp-nav-drop-menu a.is-active { color: #059669; background: rgba(5, 150, 105, .1); }

/* 教学视频二级导航条：教材同步课 / 试卷解析 */
.lp-subnav { background: #fff; border-bottom: 1px solid rgba(15, 23, 42, .06); }
.lp-subnav-inner {
    max-width: 1180px; margin: 0 auto; padding: 10px 24px;
    display: flex; flex-wrap: wrap; gap: 8px;
}
.lp-subnav a {
    padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
    color: #64748b; border: 1px solid transparent; transition: .18s;
}
.lp-subnav a:hover { color: #059669; background: rgba(5, 150, 105, .07); }
.lp-subnav a.is-active {
    color: #fff; background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 8px 18px -12px rgba(5, 150, 105, .7);
}

.lp-nav-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.lp-nav-actions .lp-icon-btn {
    display: flex; align-items: center; gap: 8px;
    color: #334155; font-size: 14px; font-weight: 500;
    padding: 8px 12px; border-radius: 10px; transition: .2s;
}
.lp-nav-actions .lp-icon-btn:hover { color: #059669; background: rgba(5, 150, 105, .08); }
.lp-nav-actions .lp-icon-btn img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* 导航里用到的按钮样式（首页完整定义见 index.html，这里只要导航需要的三个变体） */
.lp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1;
    padding: 12px 20px; border-radius: 12px; border: 1px solid transparent;
    cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    white-space: nowrap;
}
.lp-btn-primary {
    color: #fff !important;
    background: linear-gradient(135deg, #059669 0%, #10b981 60%, #34d399 100%);
    box-shadow: 0 10px 24px rgba(5, 150, 105, .34);
}
.lp-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(5, 150, 105, .42); }
.lp-btn-sm { padding: 9px 15px; font-size: 13px; border-radius: 10px; }

/* 移动端菜单按钮：三条横线，展开后变 X；桌面端隐藏 */
.lp-nav-toggle {
    display: none; align-items: center; justify-content: center;
    flex-direction: column; gap: 5px;
    width: 40px; height: 40px; margin-left: 2px; padding: 0;
    border: 0; border-radius: 10px; background: transparent; cursor: pointer;
}
.lp-nav-toggle span {
    display: block; width: 20px; height: 2px; border-radius: 2px; background: #334155;
    transition: transform .2s ease, opacity .2s ease;
}
.lp-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.lp-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.lp-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端菜单里的账号入口，桌面端不显示 */
.lp-nav-mobile-actions { display: none; }

@media (max-width: 991px) {
    /* 窄屏：横向链接折叠成下拉菜单，点汉堡展开 */
    .lp-nav-toggle { display: inline-flex; margin-left: auto; }

    /* 登录 / 注册收进下拉菜单，只留语言切换，避免小屏挤爆 */
    .lp-nav-actions .lp-icon-btn,
    .lp-nav-actions .lp-btn { display: none; }

    .lp-nav-links {
        position: absolute; top: 100%; left: 0; right: 0;
        display: none; flex-direction: column; align-items: stretch;
        gap: 2px; margin: 0; padding: 10px 16px 16px;
        background: #fff;
        border-bottom: 1px solid rgba(15, 23, 42, .08);
        box-shadow: 0 18px 32px -20px rgba(2, 6, 23, .35);
        max-height: calc(100vh - 60px); overflow-y: auto;
    }
    .lp-nav-links.is-open { display: flex; }
    .lp-nav-links a { padding: 12px 14px; font-size: 15px; border-radius: 10px; }

    /* 移动端：下拉菜单直接展开成缩进子项，不悬浮 */
    .lp-nav-drop { display: block; }
    .lp-nav-drop > a::after { content: none; }
    .lp-nav-drop-menu {
        position: static; transform: none; opacity: 1; visibility: visible;
        min-width: 0; margin: 0; padding: 0 0 0 14px;
        border: 0; box-shadow: none; background: transparent;
    }
    .lp-nav-drop-menu a { padding: 10px 14px; font-size: 14px; color: #64748b; }

    .lp-nav-mobile-actions {
        display: flex; flex-direction: column; gap: 8px;
        margin-top: 10px; padding-top: 14px;
        border-top: 1px solid #eef2f7;
    }
    .lp-nav-mobile-actions .lp-btn { width: 100%; }
    .lp-nav-mobile-actions .lp-btn:not(.lp-btn-primary) {
        border-color: #d7e0dd; color: #334155; background: #f8fafc;
    }
}

@media (max-width: 767px) {
    body.has-site-nav { padding-top: 60px; }
    .lp-nav-inner { height: 60px; gap: 12px; }
    .lp-brand .lp-logo-plate { width: 118px; height: 32px; border-radius: 8px; }
    .lp-brand .lp-logo-plate img { width: 257px; height: 64px; left: -69px; top: -17px; }
    .lp-nav-actions .lp-icon-btn span { display: none; }
    .lp-wrap { padding: 0 16px; }
}
