/* ============================================================
   _nav.css - 导航栏结构样式
   引用方式：在 index.html 中用 <link> 引入，放在 style.css 之后
   ============================================================ */

/* ============================================================
   ① 导航栏整体容器
   ============================================================ */
.top-nav {
    /* 固定顶部 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 8vmin;              /* ★ 导航栏高度，随视口等比例缩放 */

    /* 内部布局：左右分布 */
    display: flex;
    align-items: center;        /* 垂直居中 */
    justify-content: space-between; /* 左logo右按钮 */

    /* 内边距（左右留白） */
    padding: 0 4vmin;           /* ★ 左右边距，随视口等比例缩放 */

    /* 层级（高于 hero 背景，低于白幕） */
    z-index: 1000;

    /* 背景：上方深色渐变到下方透明（盖在 hero 图片上） */
    /* ★ 颜色深度可在此调整，或删除此行改为纯色/透明 */
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.40) 0%,   /* ★ 顶部背景色及透明度：0.4 = 40% 黑色 */
        rgba(0, 0, 0, 0.18) 55%,   /* ★ 中间过渡透明度 */
        rgba(0, 0, 0, 0.00) 100%   /* ★ 底部完全透明 */
    );
    /* 兼容 Safari 磨砂玻璃 */
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);

    /* 磨砂玻璃效果（支持 Safari） */
    backdrop-filter: blur(6px);          /* ★ 模糊程度，越大越模糊 */
    -webkit-backdrop-filter: blur(6px);
}

/* ============================================================
   ② 导航栏左侧 Logo 区域
   ★ 接口：后期实现时替换 <div class=\"nav-logo\"> 内容即可
   ============================================================ */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 1vmin;                 /* ★ Logo 和文字之间的间距，随视口等比例缩放 */
    text-decoration: none;
    height: 100%;
}

.nav-logo-icon {
    height: 6vmin;               /* ★ Logo 图标高度，相对于导航栏（8vmin），留出上下边距避免过大 */
    width: auto;                 /* 保持原始宽高比（SVG viewBox 205:181） */
    display: block;
}

/* ★ 定位基准：容器尺寸由六边形决定，cpsl.svg 基于它居中，
   不受视口单位影响 —— 任何分辨率下都稳定在六边形中部 */
.nav-logo-mark {
    position: relative;
    display: block;
    line-height: 0;
    flex-shrink: 0;
}

.nav-logo-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 40%;               /* ★ Logo 文字高度，随六边形缩放 */
    width: auto;
    display: block;
}

/* ============================================================
   ③ 导航栏右侧按钮组
   ============================================================ */
.nav-links {
    display: flex;
    align-items: center;        /* 按钮垂直居中 */
    gap: 0;                     /* ★ 按钮之间的间距 */
    height: 100%;               /* 撑满导航栏高度，按钮自动垂直居中 */
    margin-left: auto;          /* 将按钮组推到右侧 */
}

/* ============================================================
   ④ 响应式：小屏幕下缩小按钮间距（可选，已使用vmin，可能不需要）
   ============================================================ */
@media (max-width: 768px) {
    .top-nav {
        padding: 0 2vmin;       /* ★ 小屏左右边距 */
    }
    .nav-links {
        gap: 1.2vmin;           /* ★ 小屏按钮间距 */
    }
}
/* ============================================================
   ⑥ 六边形右侧 C.P.S. 文字（可点击，与六边形一起触发侧栏）
   ============================================================ */
.nav-logo {
    cursor: pointer;
    user-select: none;                /* 不选中，只当按钮 */
}

.nav-logo-cps {
    font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 2.6vmin;               /* ★ 字号，随视口等比缩放 */
    font-weight: 700;
    letter-spacing: 0.1em;           /* ★ 大写字距 */
    color: #ffffff;                   /* 白色，压在深色渐变上 */
    margin-left: 0.4vmin;
    margin-right: -1.2vmin;           /* 抵掉 link-text 的左偏移，保持紧凑 */
    white-space: nowrap;
    -webkit-text-stroke: 0.35px rgba(0, 0, 0, 0.35);  /* 浅背景下也可读 */
    text-shadow: 0 0 0.6vmin rgba(0, 0, 0, 0.45);
}

.nav-logo:hover .nav-logo-cps {
/*    color: rgba(80, 140, 255, 0.95);  /* 悬停变蓝，与其他按钮一致 */
}

@media (max-width: 768px) {
    .nav-logo-cps {
        font-size: 1.5vmin;
    }
}

/* ============================================================
   ⑦ 左侧抽屉（Drawer）
   ============================================================ */
.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 30vmin;                    /* ★ 抽屉宽度，随视口等比缩放 */
    min-width: 220px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0.8vmin 0 2.4vmin rgba(0, 0, 0, 0.22);
    transform: translateX(-100%);     /* 默认藏在屏幕左侧外 */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;                    /* 高于导航栏（1000） */
    display: flex;
    flex-direction: column;
    padding: 2.4vmin 0;
}

/* 展开态 */
.nav-drawer.is-open {
    transform: translateX(0);
}

/* 遮罩：点击空白处收起 */
.nav-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    z-index: 1900;
}

.nav-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* 抽屉头部 */
.nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.4vmin 1.6vmin;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.nav-drawer-title {
    font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 2.2vmin;
    font-weight: 700;
    letter-spacing: 0.28em;
    color: #1a1a1a;
}

.nav-drawer-close {
    font-family: inherit;
    font-size: 3vmin;
    line-height: 1;
    color: rgba(0, 0, 0, 0.6);
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0 0.8vmin;
    transition: color 0.2s ease;
}

.nav-drawer-close:hover {
    color: rgba(0, 0, 0, 0.9);
}

/* 抽屉条目 */
.nav-drawer-list {
    list-style: none;
    margin: 0;
    padding: 1.6vmin 0;
}

.nav-drawer-link {
    display: block;
    padding: 1.6vmin 2.4vmin;
    font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 2.2vmin;               /* ★ 字号，随视口等比缩放 */
    color: rgba(0, 0, 0, 0.85);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-drawer-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(80, 140, 255, 0.95);  /* 悬停变蓝 */
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-drawer {
        width: 60vw;
        min-width: 0;
    }
    .nav-drawer-title {
        font-size: 3.4vmin;
    }
    .nav-drawer-link {
        font-size: 3vmin;
    }
    .nav-drawer-close {
        font-size: 4vmin;
    }
}
