/* ===== Global color tokens (kept in :root) ===== */
:root{
  /* 色彩（保留为全局，以便主题统一） */
  --g1: #071827; /* 深海色 */
  --g2: #0f6b78; /* 青蓝 */
  --g3: #7fe6ea; /* 浅蓝 */
  --accent: #7fe6ea;

  /* 文字与可读性 */
  --text-dim: rgba(255,255,255,0.95);
}

/* ===== Layout & effect tokens (moved closer to #menu usage) ===== */
#menu{
  /* 布局相关变量（局部定义，按你要求把 root 分散下去） */
  --menu-collapsed-translate: 102%;
  --menu-expanded-translate: 0;
  --menu-width: 16.5em; /* 展开宽度 */
  --menu-max-width: 92vw;
  --menu-pad-vertical: 2.8rem;
  --menu-pad-horizontal: 1.6rem;
  position: fixed;
  top: 0;
  right: 0;
  width: var(--menu-width);
  max-width: var(--menu-max-width);
  height: 100vh;
  padding: var(--menu-pad-vertical) var(--menu-pad-horizontal) 2rem var(--menu-pad-horizontal);
  z-index: 10002;
  overflow-y: auto;
  border-radius: 0;
  background:
    linear-gradient(135deg, var(--g1) 0%, var(--g2) 60%, var(--g3) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.02));
  background-blend-mode: overlay, normal;
  box-shadow: -6px 0 36px 0 var(--shadow-strong), 0 10px 48px -18px rgba(30,80,100,0.12);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  opacity: var(--menu-opacity);
  transform: translateX(var(--menu-collapsed-translate));
  transition:
    transform 0.36s cubic-bezier(.2,.9,.3,1),
    box-shadow 0.28s ease,
    filter 0.28s ease;
  display: flex;
  flex-direction: column;
  gap: 2.3em;
  border-left: none;
  will-change: transform;
}

/* 展开态（继续使用 body.is-menu-visible 控制） */
body.is-menu-visible #menu {
  transform: translateX(var(--menu-expanded-translate));
  box-shadow: -28px 0 100px 0 var(--shadow-strong), 0 10px 48px -10px rgba(10,90,110,0.18);
  filter: contrast(1.02) saturate(1.05);
  opacity: 1; /* 展开时更清晰 */
}

/* 轻度遮罩（颜色更适配新配色） */
body.is-menu-visible::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(to right, rgba(3,10,18,0.36), rgba(3,10,18,0.04));
  pointer-events: auto;
  transition: opacity 0.28s ease;
  opacity: 1;
}


#menu nav a {
  display: flex;
  align-items: center;
  gap: 0.85em;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1.14em;
  font-weight: 600;
  padding: .7em 1.3em .7em 1.1em;
  border-radius: 0;
  position: relative;
  transition:
    background .18s ease,
    color .16s ease,
    transform .18s cubic-bezier(.2,.9,.3,1),
    box-shadow .18s ease;
  transform-origin: right center;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  /* 文字渐变改为更沉稳的青蓝系 */
  background: linear-gradient(90deg, #9feff0 0%, #6bd2cf 60%);
  opacity: 0;
  transform: translateX(10px) scale(.995);
}

/* hover / active（无圆角） */
#menu nav a:hover,
#menu nav a.active {
  background: linear-gradient(90deg, rgba(255,255,255,0.92) 0%, rgba(240,250,251,0.9) 100%);
  -webkit-text-fill-color: transparent;
  color: var(--accent);
  box-shadow: 0 6px 22px rgba(30,120,140,0.10);
  transform: translateX(0) scale(1.02);
}

/* 进场延迟（展开时更有层次感） */
body.is-menu-visible #menu nav a {
  opacity: 1;
  transform: translateX(0) scale(1);
}
body.is-menu-visible #menu nav a:nth-child(1){ transition-delay: .03s; }
body.is-menu-visible #menu nav a:nth-child(2){ transition-delay: .06s; }
body.is-menu-visible #menu nav a:nth-child(3){ transition-delay: .09s; }
body.is-menu-visible #menu nav a:nth-child(4){ transition-delay: .12s; }
body.is-menu-visible #menu nav a:nth-child(5){ transition-delay: .15s; }

/* ---- 快速覆盖：移除常见的分割线来源（hr / border / 伪元素 / 重复背景线） ---- */

/* 1) 如果是 <hr>，直接隐藏 */
#menu hr {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  height: 0 !important;
}

/* 2) 去掉菜单内部元素可能的 border（包括点状或虚线） */
#menu,
#menu nav,
#menu nav li,
#menu nav a,
#menu .social,
#menu .social a {
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
  background-image: none !important; /* 防止 repeating-linear-gradient 造成的“线” */
  box-shadow: none !important;
}

/* 3) 隐藏可能由伪元素绘制的分割线（::before / ::after） */
#menu *::before,
#menu *::after {
  content: none !important;
  display: none !important;
  background: none !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* 4) 针对 <a> 链接的虚线 / focus outline（避免浏览器默认焦点产生明显虚线） */
/* 注意：为不破坏无障碍，建议保留 :focus-visible 的低调样式；这里先移除突兀线，后面可替换为更弱的 focus 样式 */
#menu a,
#menu button {
  outline: none !important;
}
#menu a:focus,
#menu button:focus,
#menu a:active,
#menu button:active {
  outline: none !important;
  box-shadow: none !important;
}

/* 5) 常见类名防护（如果项目里用了这些类名的分隔符） */
#menu .divider,
#menu .sep,
#menu .line,
#menu .separator {
  display: none !important;
}

/* 6) 额外：确保不会有重复背景图在某些子元素上显示为线 */
#menu * {
  background-repeat: no-repeat !important;
  background-position: center !important;
}
/* 移动端 */
@media (max-width: 600px) {
  /* 在移动端把 layout 变量微调（局部覆盖） */
  #menu {
    --menu-width: 99vw;
    --menu-pad-vertical: 1.7rem;
    --menu-pad-horizontal: 0.7rem;
    width: var(--menu-width);
    border-radius: 0;
    padding: var(--menu-pad-vertical) var(--menu-pad-horizontal) 1.4rem var(--menu-pad-horizontal);
    transform: translateX(100%);
  }
  body.is-menu-visible #menu { transform: translateX(0); }
  body.is-menu-visible::before { background: rgba(0,0,0,0.5); }
  #menu .social { justify-content: center; }
}
