/* ============================================================
   烟雨涧 · 小工具页导航
   配色沿用「水墨青灰」，与首页导航完全同源
   ============================================================ */

/* ---------- 变量 ---------- */
:root{
  --nav-h: 60px;
  --radius: 8px;
  --ease: cubic-bezier(.22,.61,.36,1);

  /* 水墨青灰 */
  --nav-bg:   rgba(245,249,248,.78);
  --panel-bg: rgba(248,251,250,.97);
  --fg:       #17221f;
  --muted:    #7d8c88;
  --hover:    rgba(37,70,63,.055);
  --line:     rgba(30,62,55,.10);
  --btn-bg:   #24413c;
  --btn-fg:   #f7faf9;
  --btn-bg-h: #31544d;
  --logo:     #1c3a34;
  --dot:      #4a7a70;
  --shadow:   0 1px 2px rgba(28,58,52,.05), 0 8px 24px rgba(28,58,52,.07);
}

/* ---------- 深色模式 ---------- */
@media (prefers-color-scheme: dark){
  :root{
    --nav-bg:   rgba(14,22,20,.74);
    --panel-bg: rgba(18,26,24,.97);
    --fg:       #e6efec;
    --muted:    #8a9a95;
    --hover:    rgba(255,255,255,.055);
    --line:     rgba(255,255,255,.10);
    --btn-bg:   #dfe9e5;
    --btn-fg:   #16211f;
    --btn-bg-h: #f0f6f4;
    --logo:     #eef5f3;
    --dot:      #7fb3a7;
    --shadow:   0 8px 24px rgba(0,0,0,.5);
  }
}

/* ---------- 基础 ---------- */
*{ box-sizing: border-box; }
body{
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 导航容器 ---------- */
.head{
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 28px;
  height: var(--nav-h);
  padding: 0 clamp(16px, 4vw, 40px);
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease), background .3s var(--ease);
}
.head.is-scrolled{ box-shadow: var(--shadow); }

/* 不支持毛玻璃时降级为实色 */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))){
  .head{ background: var(--panel-bg); }
}

/* ============================================================
   左侧：小工具 + 分隔线 + 返回
   ============================================================ */
.brand-group{
  flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
}

/* 标题 —— 沿用首页 Logo 的字重与字距 */
.brand{
  display: inline-flex; align-items: center;
  font-size: 17px; font-weight: 600; letter-spacing: .14em;
  color: var(--logo); text-decoration: none;
}
.brand::before{
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--dot); margin-right: 10px;
  transition: transform .35s var(--ease);
}
.brand:hover::before{ transform: scale(1.6); }

/* 竖线分隔 */
.divider{
  width: 1px; height: 14px; border-radius: 1px;
  background: var(--line);
}

/* 返回键 */
.back{
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 10px 0 7px;
  margin-left: -4px;                 /* 让箭头视觉上左对齐 */
  border-radius: var(--radius);
  font-size: 14px; font-weight: 450; letter-spacing: .02em;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.back-ico{
  width: 15px; height: 15px;
  transition: transform .25s var(--ease);
}
.back:hover{ color: var(--fg); background: var(--hover); }
.back:hover .back-ico{ transform: translateX(-3px); }   /* 箭头回退 */
.back:active{ transform: translateY(.5px); }
.back:focus-visible{ outline: 2px solid var(--fg); outline-offset: 2px; }

/* ============================================================
   右侧菜单
   ============================================================ */
.li1{
  display: flex; align-items: center; gap: 2px;
  margin: 0 0 0 auto; padding: 0; list-style: none;
}
.li1 a{
  display: inline-flex; align-items: center;
  height: 34px; padding: 0 13px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 450; letter-spacing: .01em;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.li1 a:hover{ color: var(--fg); background: var(--hover); }
.li1 a:focus-visible{ outline: 2px solid var(--fg); outline-offset: 2px; }

/* 最后一项自动渲染为实心按钮 */
.li1 li:last-child a{
  margin-left: 12px; padding: 0 16px;
  color: var(--btn-fg); background: var(--btn-bg); font-weight: 500;
}
.li1 li:last-child a:hover{ background: var(--btn-bg-h); color: var(--btn-fg); }

/* ============================================================
   汉堡按钮
   ============================================================ */
.nav-btn{
  display: none; margin-left: auto;
  width: 36px; height: 36px; place-content: center; gap: 5px;
  border-radius: 9px; cursor: pointer;
  transition: background-color .2s var(--ease);
}
.nav-btn:hover{ background: var(--hover); }
.nav-btn span{
  display: block; width: 18px; height: 1.5px; border-radius: 2px;
  background: var(--fg);
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.nav-toggle:checked ~ .nav-btn span:nth-child(1){ transform: translateY(6.5px) rotate(45deg); }
.nav-toggle:checked ~ .nav-btn span:nth-child(2){ opacity: 0; }
.nav-toggle:checked ~ .nav-btn span:nth-child(3){ transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================================
   移动端
   ============================================================ */
@media (max-width: 768px){
  .head{ gap: 12px; }
  .nav-btn{ display: grid; }
  .brand{ font-size: 16px; letter-spacing: .1em; }
  .brand::before{ margin-right: 8px; }
  .brand-group{ gap: 8px; }

  .li1{
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    margin: 0; padding: 0 12px;
    background: var(--panel-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; opacity: 0; visibility: hidden;
    transition: max-height .34s var(--ease), opacity .24s var(--ease),
                visibility .34s var(--ease), padding .34s var(--ease);
  }
  .nav-toggle:checked ~ .li1{
    max-height: 70vh; opacity: 1; visibility: visible;
    padding: 8px 12px 16px; box-shadow: var(--shadow);
  }
  .li1 a{ height: 46px; padding: 0 12px; font-size: 15px; border-radius: 9px; }
  .li1 li:last-child a{ margin: 8px 0 0; justify-content: center; }

  /* 返回键窄屏保留箭头 + 文字，点击热区补足到 36px */
  .back{ height: 36px; padding: 0 9px 0 6px; }
}

/* 极窄屏只留箭头，避免和标题挤在一起 */
@media (max-width: 360px){
  .back span{ display: none; }
  .back{ padding: 0 8px; }
}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce){
  *{ transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ============================================================
   联系卡片 .wx1 / .wx2 —— 与导航栏同源（水墨青灰）
   ============================================================ */
.wx1{
  position: relative;
  max-width: 520px;
  margin: clamp(28px, 7vw, 64px) auto 0;
  padding: clamp(16px, 3vw, 22px);
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  overflow: hidden;
}

/* 顶部一道渐隐墨线，呼应导航的下边框 */
.wx1::before{
  content: "";
  position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, var(--dot), transparent);
  opacity: .55;
}

/* ---------- 每一行联系方式 ---------- */
.wx2{
  position: relative;
  display: flex; align-items: center;
  margin: 0;
  padding: 13px 14px 13px 32px;
  border-radius: var(--radius);
  font-size: 15px; font-weight: 450; letter-spacing: .02em;
  line-height: 1.5;
  color: var(--fg);
  -webkit-user-select: all;          /* 点一下整行选中，方便复制 */
  user-select: all;
  cursor: text;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.wx2 + .wx2{ margin-top: 2px; }

/* 行首小圆点，沿用 .brand 的那颗 */
.wx2::before{
  content: "";
  position: absolute; left: 15px; top: 50%;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--dot); opacity: .7;
  transform: translateY(-50%);
  transition: transform .35s var(--ease), opacity .2s var(--ease);
}
.wx2:hover{ background: var(--hover); }
.wx2:hover::before{ transform: translateY(-50%) scale(1.6); opacity: 1; }

/* ---------- 最后一行「温馨提醒」降级为脚注 ---------- */
.wx2:last-child{
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  font-size: 13.5px; font-weight: 400;
  color: var(--muted);
  cursor: default;
}
.wx2:last-child::before{ opacity: .45; }
.wx2:last-child:hover{ background: transparent; }
.wx2:last-child:hover::before{ transform: translateY(-50%) scale(1); }

/* ---------- 窄屏 ---------- */
@media (max-width: 768px){
  .wx1{ margin: 22px 16px 0; border-radius: 12px; }
  .wx2{ padding: 12px 12px 12px 30px; font-size: 14.5px; }
}