/* ============================================================
   共享导航：印章式 Logo + 右上角折叠菜单
   在 home.css / site.css 之后加载，负责覆盖旧 .brand / .topnav
   ============================================================ */

.topbar { position: relative; z-index: 60; }

/* ---------- 「余」字印章 ---------- */
.brand {
  display: inline-flex; align-items: center;
  text-decoration: none; line-height: 0;
}
.seal {
  position: relative;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(150, 180, 255, .38);
  background:
    linear-gradient(145deg, rgba(124,155,255,.20), rgba(139,92,246,.12) 48%, rgba(7,10,17,.55));
  box-shadow:
    0 10px 30px -18px rgba(79, 110, 247, .95),
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -8px 18px -12px rgba(0, 0, 0, .8);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .45s;
}
/* 印面细密斜纹 */
.seal::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg,
    rgba(255,255,255,.055) 0 1px, transparent 1px 4px);
  opacity: .7;
}
/* 左上柔光 */
.seal::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 80% at 22% 12%, rgba(255,255,255,.24), transparent 62%);
  opacity: .9;
}
.seal-char {
  position: relative; z-index: 1;
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: 25px; font-weight: 600; font-style: normal;
  line-height: 1; letter-spacing: 0;
  background: linear-gradient(160deg, #f2f6ff 0%, #a9c0ff 52%, #c7a6ff 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  transform: translateY(-1px);
}
.brand:hover .seal,
.brand:focus-visible .seal {
  transform: translateY(-1px) rotate(-3deg);
  border-color: rgba(180, 150, 255, .62);
  box-shadow:
    0 14px 34px -16px rgba(124, 155, 255, .95),
    inset 0 1px 0 rgba(255, 255, 255, .22);
}

/* 顶栏底部分隔线：两端渐隐，只做极轻的分层 */
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg,
    rgba(140,170,255,0) 0%,
    rgba(140,170,255,.14) 18%,
    rgba(160,190,255,.20) 50%,
    rgba(140,170,255,.14) 82%,
    rgba(140,170,255,0) 100%);
  pointer-events: none;
}

/* ---------- 顶栏居中签名（两侧装饰线） ---------- */
.head-sign-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  margin: 0 14px;
}
/* 装饰线：向两侧渐隐 + 靠文字端一颗小光点 */
.hs-rule {
  position: relative;
  flex: 1 1 auto;
  min-width: 8px; max-width: 78px;
  height: 1px;
}
.hs-rule::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(150,180,255,0), rgba(160,190,255,.55));
}
.hs-rule::after {
  content: ''; position: absolute; top: -2px; right: -2px;
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(180,200,255,.9);
  box-shadow: 0 0 10px rgba(124,155,255,.95);
}
.hs-rule-r::before {
  background: linear-gradient(90deg, rgba(160,190,255,.55), rgba(150,180,255,0));
}
.hs-rule-r::after { right: auto; left: -2px; }

.head-sign {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  text-align: center;
  cursor: pointer;                 /* 可点击换一句 */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 8px;
  transition: color .2s, text-shadow .25s, transform .15s;
  font-family: 'Songti SC', 'STSong', 'Noto Serif SC', serif;
  font-size: clamp(13px, 3.6vw, 17px);
  line-height: 1.3;
  letter-spacing: .08em;
  color: #c9d6ef;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0;
  animation: headSignIn .8s cubic-bezier(.2,.8,.2,1) .15s forwards;
}
@keyframes headSignIn { to { opacity: 1; } }

.head-sign:hover {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(124, 155, 255, .65);
}
.head-sign:active { transform: scale(.97); }
.head-sign:focus-visible {
  outline: 1px solid rgba(124, 155, 255, .75);
  outline-offset: 4px;
}

/* ---------- 折叠按钮 ---------- */
.nav-wrap {
  position: relative;
  margin-left: auto;
  display: flex; align-items: center;
}
.nav-toggle {
  width: 44px; height: 44px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 0; cursor: pointer;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .045);
  color: #dbe5ff;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s, border-color .2s, box-shadow .25s;
}
.nav-toggle:hover { background: rgba(124, 155, 255, .15); border-color: rgba(124, 155, 255, .48); }
.nav-toggle:focus-visible { outline: 2px solid rgba(124, 155, 255, .8); outline-offset: 3px; }
.nav-toggle span {
  display: block;
  width: 18px; height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .2s;
}
.nav-toggle span + span { margin-top: 4px; }
.nav-wrap.open .nav-toggle { background: rgba(124, 155, 255, .18); border-color: rgba(124, 155, 255, .55); }
.nav-wrap.open .nav-toggle span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.nav-wrap.open .nav-toggle span:nth-child(2) { opacity: 0; transform: scaleX(.4); }
.nav-wrap.open .nav-toggle span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

/* ---------- 下拉菜单 ---------- */
.nav-menu {
  position: absolute;
  top: calc(100% + 14px); right: 0;
  z-index: 70;
  min-width: 208px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(124, 155, 255, .22);
  background: rgba(9, 13, 22, .94);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow:
    0 28px 60px -26px rgba(0, 0, 0, .95),
    inset 0 1px 0 rgba(255, 255, 255, .07);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px) scale(.97);
  transform-origin: top right;
  transition: opacity .2s ease, transform .26s cubic-bezier(.2,.8,.2,1), visibility .26s;
}
.nav-wrap.open .nav-menu { opacity: 1; visibility: visible; transform: none; }

.nav-menu a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #c9d6ef; text-decoration: none;
  font-size: 14.5px; line-height: 1;
  transition: background .16s, color .16s, padding-left .2s;
}
.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: rgba(124, 155, 255, .14);
  color: #fff;
  padding-left: 16px;
  outline: none;
}
.nav-menu a[aria-current="page"] {
  color: #fff;
  background: rgba(124, 155, 255, .17);
  box-shadow: inset 2px 0 0 rgba(140, 170, 255, .9);
}
.nav-menu .idx {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .08em;
  color: rgba(140, 170, 255, .55);
  font-variant-numeric: tabular-nums;
}
.nav-menu .sep { height: 1px; margin: 6px 10px; background: rgba(255, 255, 255, .07); }
.nav-menu .hint {
  margin: 0;
  padding: 8px 12px 6px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(140, 160, 200, .45);
}

@media (max-width: 560px) {
  .seal { width: 42px; height: 42px; border-radius: 13px; }
  .seal-char { font-size: 23px; }
  .nav-menu { min-width: 190px; }
  .head-sign-wrap { margin: 0 6px; gap: 9px; }
  .head-sign { font-size: 12.5px; letter-spacing: .03em; }
  .hs-rule { max-width: 40px; }
}

/* 无动画偏好：去掉位移过渡 */
@media (prefers-reduced-motion: reduce) {
  .head-sign { animation: none; opacity: 1; }
  .seal, .nav-toggle span, .nav-menu, .nav-menu a { transition: none !important; }
  .brand:hover .seal { transform: none; }
}

/* ============ 全站线稿背景（锦鲤） ============ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;                     /* 在极光与雨滴之下 */
  background: url('/koi-lines.svg') center center / cover no-repeat;
  opacity: .23;
  pointer-events: none;
}

/* 桌面/平板横屏：按高度缩放（保持线宽纤细），靠右摆放并向左渐隐，让出正文区 */
@media (min-width: 901px) {
  body::before {
    background-size: auto 118%;
    background-position: right -3% center;
    opacity: .16;
    -webkit-mask-image: linear-gradient(100deg,
      rgba(0,0,0,0) 0%, rgba(0,0,0,.28) 24%, rgba(0,0,0,.82) 50%, #000 76%);
    mask-image: linear-gradient(100deg,
      rgba(0,0,0,0) 0%, rgba(0,0,0,.28) 24%, rgba(0,0,0,.82) 50%, #000 76%);
  }
}
@media (max-width: 640px) {
  body::before { background-size: contain; opacity: .23; }
}

/* ============ 页脚：两行居中 ============ */
.foot {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
}
.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* 备案信息单独一排，字号更小、存在感更低 */
.foot-filing {
  font-size: 11.5px;
  letter-spacing: .04em;
  color: #4a5871;
}

@media (max-width: 640px) {
  .foot { gap: 6px; }
  .foot-filing { font-size: 11px; }
}
