/* ============================================
   PC顶部菜单 - Generate 按钮风格
   From Uiverse.io by shokat_2650
   ============================================ */

@property --angle-1 {
  syntax: "<angle>";
  inherits: false;
  initial-value: -75deg;
}

@property --angle-2 {
  syntax: "<angle>";
  inherits: false;
  initial-value: -45deg;
}

:root {
  --anim--hover-time: 400ms;
  --anim--hover-ease: cubic-bezier(0.25, 1, 0.5, 1);
}

/* === 仅 PC 端生效 === */
@media screen and (min-width: 768px) {

/* ===== 菜单项容器（对应 .button-wrap） ===== */
.header-nav .navbar-header > li,
.header-nav .navbar-header > li.menu-item {
  position: relative;
  z-index: 2;
  border-radius: 999vw;
  background: transparent;
  transition: all var(--anim--hover-time) var(--anim--hover-ease);
  margin-right: 8px;
}
.header-nav .navbar-header > li:last-child {
  margin-right: 0;
}

/* 隐藏原始主题的底部下划线指示器 */
.header-nav .navbar-header > li::after,
.header-nav .navbar-header > li.menu-item::after {
  display: none !important;
}

/* ===== 模拟 .button-shadow（用 li::before） ===== */
.header-nav .navbar-header > li::before {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 999vw;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1));
  width: calc(100% - 0.25em);
  height: calc(100% - 0.25em);
  top: 0.5em;
  left: 0.125em;
  padding: 0.125em;
  box-sizing: border-box;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  filter: blur(clamp(2px, 0.125em, 12px));
  -webkit-filter: blur(clamp(2px, 0.125em, 12px));
  transition: all var(--anim--hover-time) var(--anim--hover-ease);
  opacity: 1;
  pointer-events: none;
}

/* 悬停时阴影 */
.header-nav .navbar-header > li:has(> a:hover)::before {
  top: 0.75em;
  opacity: 1;
}

/* 激活时阴影 */
.header-nav .navbar-header > li:has(> a:active)::before {
  top: 0.5em;
  opacity: 0.75;
}

/* 激活时容器倾斜 */
.header-nav .navbar-header > li:has(> a:active) {
  transform: rotate3d(1, 0, 0, 25deg);
}

/* ===== 菜单链接（对应 button）- 使用最高优先级选择器 ===== */
.header-nav .navbar-header > li > a,
.header-nav .navbar-header > li.menu-item > a,
.header-nav .navbar-header li.current-menu-item > a,
.header-nav .navbar-header li.current-menu-ancestor > a,
.header-nav .navbar-header li.current-menu-parent > a {
  --border-width: clamp(1px, 0.0625em, 4px);
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  pointer-events: auto;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    -75deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.05)
  ) !important;
  border-radius: 999vw !important;
  box-shadow:
    inset 0 0.125em 0.125em rgba(0, 0, 0, 0.05),
    inset 0 -0.125em 0.125em rgba(255, 255, 255, 0.5),
    0 0.25em 0.125em -0.125em rgba(0, 0, 0, 0.2),
    0 0 0.1em 0.25em inset rgba(255, 255, 255, 0.2),
    0 0 0 0 rgba(255, 255, 255, 1) !important;
  backdrop-filter: blur(clamp(1px, 0.125em, 4px));
  -webkit-backdrop-filter: blur(clamp(1px, 0.125em, 4px));
  transition: all var(--anim--hover-time) var(--anim--hover-ease);
  text-decoration: none !important;
  border: none !important;
  /* padding 放在 a 上，而不是 span 上 */
  padding: 0.65em 1.2em !important;
  color: rgba(50, 50, 50, 1) !important;
  font-size: 15px !important;
  font-family: "Inter", sans-serif;
  letter-spacing: -0.05em !important;
  font-weight: 500 !important;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0em 0.25em 0.05em rgba(0, 0, 0, 0.1) !important;
  line-height: 1.2 !important;
}

/* 悬停 */
.header-nav .navbar-header > li > a:hover,
.header-nav .navbar-header > li.menu-item > a:hover {
  transform: scale(0.975);
  backdrop-filter: blur(0.01em);
  -webkit-backdrop-filter: blur(0.01em);
  background: linear-gradient(
    -75deg,
    rgba(100, 120, 255, 0.15),
    rgba(130, 100, 255, 0.3),
    rgba(100, 120, 255, 0.15)
  ) !important;
  box-shadow:
    inset 0 0.125em 0.125em rgba(0, 0, 0, 0.05),
    inset 0 -0.125em 0.125em rgba(255, 255, 255, 0.5),
    0 0.15em 0.05em -0.1em rgba(0, 0, 0, 0.25),
    0 0 0.05em 0.1em inset rgba(200, 220, 255, 0.6),
    0 0 0 0 rgba(255, 255, 255, 1) !important;
  color: rgb(45, 60, 160) !important;
  text-shadow: 0.025em 0.025em 0.025em rgba(0, 0, 0, 0.12) !important;
}

/* 按压 */
.header-nav .navbar-header > li:has(> a:active) > a {
  box-shadow:
    inset 0 0.125em 0.125em rgba(0, 0, 0, 0.05),
    inset 0 -0.125em 0.125em rgba(255, 255, 255, 0.5),
    0 0.125em 0.125em -0.125em rgba(0, 0, 0, 0.2),
    0 0 0.1em 0.25em inset rgba(255, 255, 255, 0.2),
    0 0.225em 0.05em 0 rgba(0, 0, 0, 0.05),
    0 0.25em 0 0 rgba(255, 255, 255, 0.75),
    inset 0 0.25em 0.05em 0 rgba(0, 0, 0, 0.15) !important;
  text-shadow: 0.025em 0.25em 0.05em rgba(0, 0, 0, 0.12) !important;
}

/* ===== 文字样式（span 内文字 - 如果有的话） ===== */
.header-nav .navbar-header > li > a span {
  position: relative;
  display: block;
  user-select: none;
  font-family: "Inter", sans-serif;
  letter-spacing: -0.05em;
  font-weight: 500;
  font-size: 1em;
  color: rgba(50, 50, 50, 1) !important;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0em 0.25em 0.05em rgba(0, 0, 0, 0.1) !important;
  transition: all var(--anim--hover-time) var(--anim--hover-ease);
  /* span 不再需要 padding，padding 已移到 a 上 */
  padding: 0 !important;
  line-height: 1.2 !important;
}

.header-nav .navbar-header > li > a:hover span {
  text-shadow: 0.025em 0.025em 0.025em rgba(0, 0, 0, 0.12) !important;
  color: rgb(45, 60, 160) !important;
}

/* ===== 文字光泽扫过（覆盖在 a 本身上，不依赖 span） ===== */
.header-nav .navbar-header > li > a::before {
  content: "";
  display: block;
  position: absolute;
  z-index: 4;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  top: 1px;
  left: 1px;
  box-sizing: border-box;
  border-radius: 999vw;
  overflow: hidden;
  background: linear-gradient(
    var(--angle-2),
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 40% 50%,
    rgba(255, 255, 255, 0) 55%
  );
  mix-blend-mode: screen;
  pointer-events: none;
  background-size: 200% 200%;
  background-position: 0% 50%;
  background-repeat: no-repeat;
  transition:
    background-position calc(var(--anim--hover-time) * 1.25) var(--anim--hover-ease),
    --angle-2 calc(var(--anim--hover-time) * 1.25) var(--anim--hover-ease);
}

.header-nav .navbar-header > li > a:hover::before {
  background-position: 25% 50%;
}

.header-nav .navbar-header > li > a:active::before {
  background-position: 50% 15%;
  --angle-2: -15deg;
}

@media (hover: none) and (pointer: coarse) {
  .header-nav .navbar-header > li > a::before,
  .header-nav .navbar-header > li > a:active::before {
    --angle-2: -45deg;
  }
}

/* ===== 旋转边框轮廓（用 a::after） ===== */
.header-nav .navbar-header > li > a::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: 999vw;
  width: calc(100% + var(--border-width));
  height: calc(100% + var(--border-width));
  top: calc(0% - var(--border-width) / 2);
  left: calc(0% - var(--border-width) / 2);
  padding: var(--border-width);
  box-sizing: border-box;
  background: conic-gradient(
      from var(--angle-1) at 50% 50%,
      rgba(0, 0, 0, 0.5),
      rgba(0, 0, 0, 0) 5% 40%,
      rgba(0, 0, 0, 0.5) 50%,
      rgba(0, 0, 0, 0) 60% 95%,
      rgba(0, 0, 0, 0.5)
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5));
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  transition:
    all var(--anim--hover-time) var(--anim--hover-ease),
    --angle-1 500ms ease;
  box-shadow: inset 0 0 0 calc(var(--border-width) / 2) rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.header-nav .navbar-header > li > a:hover::after {
  --angle-1: -125deg;
  background: conic-gradient(
      from var(--angle-1) at 50% 50%,
      rgba(60, 80, 200, 0.6),
      rgba(0, 0, 0, 0) 5% 40%,
      rgba(60, 80, 200, 0.6) 50%,
      rgba(0, 0, 0, 0) 60% 95%,
      rgba(60, 80, 200, 0.6)
    ),
    linear-gradient(180deg, rgba(220, 230, 255, 0.6), rgba(220, 230, 255, 0.6));
}

.header-nav .navbar-header > li > a:active::after {
  --angle-1: -75deg;
}

@media (hover: none) and (pointer: coarse) {
  .header-nav .navbar-header > li > a::after,
  .header-nav .navbar-header > li > a:hover::after,
  .header-nav .navbar-header > li > a:active::after {
    --angle-1: -75deg;
  }
}

/* ===== 子菜单 ===== */
.header-nav .navbar-header li:hover > .sub-menu {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 8px;
  margin-top: 4px;
}

.header-nav .navbar-header .sub-menu li {
  border-radius: 10px;
  transition: all 0.3s ease;
}

.header-nav .navbar-header .sub-menu li:hover {
  background: rgba(100, 120, 255, 0.08);
}

.header-nav .navbar-header .sub-menu li a {
  padding: 8px 14px !important;
  border-radius: 10px !important;
  color: rgba(50, 50, 50, 1) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: -0.02em !important;
  text-decoration: none !important;
  display: block !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  text-shadow: none !important;
}

.header-nav .navbar-header .sub-menu li:hover a {
  color: rgb(45, 60, 160) !important;
}

/* ===== 暗色模式 ===== */
.io-black-mode .header-nav .navbar-header > li > a,
.io-black-mode .header-nav .navbar-header > li.menu-item > a,
.io-black-mode .header-nav .navbar-header li.current-menu-item > a {
  background: linear-gradient(
    -75deg,
    rgba(255, 255, 255, 0.03),
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.03)
  ) !important;
  box-shadow:
    inset 0 0.125em 0.125em rgba(0, 0, 0, 0.2),
    inset 0 -0.125em 0.125em rgba(255, 255, 255, 0.1),
    0 0.25em 0.125em -0.125em rgba(0, 0, 0, 0.4),
    0 0 0.1em 0.25em inset rgba(255, 255, 255, 0.1),
    0 0 0 0 rgba(255, 255, 255, 1) !important;
  color: rgba(220, 220, 220, 1) !important;
}

.io-black-mode .header-nav .navbar-header > li > a:hover,
.io-black-mode .header-nav .navbar-header > li.menu-item > a:hover {
  background: linear-gradient(
    -75deg,
    rgba(100, 120, 255, 0.2),
    rgba(130, 100, 255, 0.35),
    rgba(100, 120, 255, 0.2)
  ) !important;
}

.io-black-mode .header-nav .navbar-header > li > a span {
  color: rgba(220, 220, 220, 1) !important;
}

.io-black-mode .header-nav .navbar-header > li > a:hover span {
  color: rgb(140, 160, 255) !important;
}

.io-black-mode .header-nav .navbar-header > li > a::after {
  background: conic-gradient(
      from var(--angle-1) at 50% 50%,
      rgba(255, 255, 255, 0.3),
      rgba(0, 0, 0, 0) 5% 40%,
      rgba(255, 255, 255, 0.3) 50%,
      rgba(0, 0, 0, 0) 60% 95%,
      rgba(255, 255, 255, 0.3)
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15));
  box-shadow: inset 0 0 0 calc(var(--border-width) / 2) rgba(255, 255, 255, 0.2);
}

.io-black-mode .header-nav .navbar-header > li > a:hover::after {
  background: conic-gradient(
      from var(--angle-1) at 50% 50%,
      rgba(100, 130, 255, 0.6),
      rgba(0, 0, 0, 0) 5% 40%,
      rgba(100, 130, 255, 0.6) 50%,
      rgba(0, 0, 0, 0) 60% 95%,
      rgba(100, 130, 255, 0.6)
    ),
    linear-gradient(180deg, rgba(200, 210, 255, 0.3), rgba(200, 210, 255, 0.3));
}

.io-black-mode .header-nav .navbar-header li:hover > .sub-menu {
  background: rgba(30, 30, 35, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
}

.io-black-mode .header-nav .navbar-header .sub-menu li:hover {
  background: rgba(100, 120, 255, 0.12);
}

.io-black-mode .header-nav .navbar-header .sub-menu li a {
  color: rgba(200, 200, 200, 1) !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  text-shadow: none !important;
}

.io-black-mode .header-nav .navbar-header .sub-menu li:hover a {
  color: rgb(140, 160, 255) !important;
}

} /* end @media min-width 768px */