/* ==========================================================================
   site-nav.css —— 站点主导航（复刻首页外观，自包含，不依赖 Tailwind）
   --------------------------------------------------------------------------
   用途：给手写模板的文章页（news/*.html 中无 Tailwind 的那批）提供与首页
        一致的导航栏。样式值取自首页实际计算值：
          --glass-blur-heavy   blur(24px)
          --glass-border-soft  rgba(255,255,255,.08)
          --glass-radius-xl    32px
          --glass-ink          #f5f6f8
          --glass-ink-70       rgba(245,246,248,.72)
          --glass-accent       #d99a5b
          --ease-out           cubic-bezier(.23,1,.32,1)
        交互：只保留「点击」触发下拉，无悬停触发。
   ========================================================================== */

.snx-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(16, 17, 21, 0.62);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
  font-family: inherit;
}

.snx-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px)  { .snx-inner { padding: 0 24px; } }
@media (min-width: 1024px) { .snx-inner { padding: 0 32px; } }

.snx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* ---------- 品牌区 ---------- */
.snx-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-width: 0;
}
.snx-brand img {
  width: 32px; height: 32px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
  flex: 0 0 auto;
}
.snx-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f5f6f8;
  white-space: nowrap;
}
@media (min-width: 1024px) { .snx-name { font-size: 14px; } }
@media (min-width: 1280px) { .snx-name { font-size: 16px; } }

.snx-tag {
  font-size: 12px;
  font-weight: 500;
  color: #d99a5b;
  white-space: nowrap;
  display: none;
}
@media (min-width: 1280px) { .snx-tag { display: inline; } }

/* ---------- 主导航 ---------- */
.snx-links { display: none; }

@media (min-width: 1024px) {
  .snx-links {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
}

.snx-links > a,
.snx-more > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9999px;
  font-size: 12px;
  line-height: 1.2;
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
  color: rgba(245, 246, 248, 0.72);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color .2s cubic-bezier(.23, 1, .32, 1),
              color .2s cubic-bezier(.23, 1, .32, 1),
              box-shadow .2s cubic-bezier(.23, 1, .32, 1);
}
@media (min-width: 1280px) {
  .snx-links > a, .snx-more > button { font-size: 14px; padding: 8px 12px; }
}

.snx-links > a:hover,
.snx-more > button:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }

.snx-links > a.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #f5f6f8;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.snx-press:active { transform: translateY(1px); }

/* ---------- 「更多栏目」 ---------- */
.snx-more { position: relative; }

.snx-caret {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .2s cubic-bezier(.23, 1, .32, 1);
}
.snx-more.open .snx-caret { transform: rotate(180deg); }

.snx-panel {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 10px;
  min-width: 180px;
  padding: 7px;
  background: rgba(20, 22, 26, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  display: none;
  z-index: 100001;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.snx-more.open .snx-panel { display: block; }

.snx-panel a {
  display: block;
  padding: 11px 14px;
  border-radius: 8px;
  color: rgba(233, 234, 236, 0.86);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  transition: background-color .16s ease, color .16s ease;
}
.snx-panel a:hover { background: rgba(255, 255, 255, 0.08); color: #f0c391; }

/* ---------- 右侧 登录/注册 + 汉堡 ---------- */
.snx-right { display: none; align-items: center; gap: 12px; }
@media (min-width: 1024px) { .snx-right { display: flex; } }

.snx-login {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: #1a1207;
  background: #d99a5b;
  transition: filter .2s cubic-bezier(.23, 1, .32, 1);
}
.snx-login:hover { filter: brightness(1.09); }

.snx-ham {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  font-size: 20px;
  line-height: 1;
  color: #f5f6f8;
  background: none;
  border: 0;
  cursor: pointer;
}
@media (min-width: 1024px) { .snx-ham { display: none; } }

/* ---------- 移动端抽屉 ---------- */
@media (max-width: 1023px) {
  .snx-nav.is-open .snx-links {
    display: block;
    position: fixed;
    left: 12px; right: 12px;
    top: calc(58px + env(safe-area-inset-top));
    padding: 8px;
    background: rgba(20, 22, 26, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 100001;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .snx-nav.is-open .snx-links > a {
    display: block;
    padding: 13px 15px;
    border-radius: 8px;
    font-size: 15px;
  }
  .snx-nav.is-open .snx-more { display: block; }
  .snx-nav.is-open .snx-more > button { display: none; }
  .snx-nav.is-open .snx-panel {
    position: static;
    display: block;
    margin: 0;
    padding: 0;
    min-width: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .snx-nav.is-open .snx-panel a { padding: 13px 15px; font-size: 15px; }
  /* 避免与上方 5 个主导航项重复 */
  .snx-nav.is-open .snx-panel a[href="/order-lookup"],
  .snx-nav.is-open .snx-panel a[href="/orders"],
  .snx-nav.is-open .snx-panel a[href="/after-sales"] { display: none; }
}
