/*
Theme Name: BunnyBlog
Template: bravada
Author: Bunny
Version: 1.1.0
*/

/* ---------- Video background ---------- */
#masthead {
    position: relative;
    height: 100vh !important;
    min-height: 600px;
    max-height: 1080px;
    overflow: hidden;
}

.bunny-video-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

/* Layer above video for content */
#masthead #site-header-main,
#masthead #header-image-main {
    position: relative;
    z-index: 2;
}

/* Dark vignette overlay for readability */
#masthead::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.05) 35%, rgba(0,0,0,0.05) 65%, rgba(0,0,0,0.35) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Hide Bravada default header artwork */
#masthead #header-image-main .header-image,
#masthead #header-image-main img.header-image,
#masthead #header-image-main #header-overlay {
    display: none !important;
}

/* ---------- Hide large center title ---------- */
#header-page-title,
#header-page-title-inside,
#masthead .animated-title {
    display: none !important;
}

/* ---------- Frosted-glass top bar (Antigravity style) ---------- */
#masthead #site-header-main {
    background: rgba(0, 0, 0, 0.38) !important;
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: fixed !important;
    top: 0; left: 0; right: 0;
    z-index: 50;
}

/* Admin bar offset */
body.admin-bar #masthead #site-header-main { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar #masthead #site-header-main { top: 46px; }
}

/* Shrink top bar rows */
#masthead .site-header-top,
#masthead .site-header-bottom,
#masthead .site-header-bottom-fixed,
#masthead .site-header-inside {
    background: transparent !important;
    box-shadow: none !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
#masthead .site-header-bottom-fixed .site-header-inside {
    min-height: 56px;
    display: flex;
    align-items: center;
}

/* Compact left-aligned logo */
#branding {
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    display: flex;
    align-items: center;
}
#site-text { padding: 0 !important; margin: 0 !important; }
#site-title {
    font-size: 18px !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: 600;
    letter-spacing: 0.02em;
}
#site-title a,
#site-title a:hover,
#site-title span,
#site-title span span {
    color: #ffffff !important;
    background: none !important;
    box-shadow: none !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    padding: 0 !important;
}
#site-description { display: none !important; }

/* Thin, light navigation links */
#masthead #access,
#masthead #header-menu,
#masthead nav#access ul,
#masthead #header-menu ul {
    background: transparent !important;
}
#masthead #access a,
#masthead #header-menu a,
#masthead .menu-burger {
    color: rgba(255,255,255,0.88) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    transition: color 0.2s ease;
}
#masthead #access a:hover,
#masthead #header-menu a:hover,
#masthead .menu-burger:hover {
    color: #ffffff !important;
}
#masthead #access ul li,
#masthead #header-menu ul li {
    background: transparent !important;
}

/* Top info/topbar row - hide if empty to save space */
#masthead .site-header-top:empty,
#masthead #header-menu:empty {
    display: none !important;
}

/* ---------- Push masthead content below fixed bar ---------- */
#masthead #header-image-main {
    height: 100vh !important;
    min-height: 600px;
    max-height: 1080px;
}
#masthead #header-image-main-inside {
    height: 100% !important;
    position: relative;
}

/* ---------- Scroll arrow (keep, restyle) ---------- */
#masthead .meta-arrow {
    display: block !important;
    position: absolute !important;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0.75;
    animation: bunny-bounce 2.2s ease-in-out infinite;
}
#masthead .meta-arrow .icon-arrow,
#masthead .meta-arrow i {
    color: #ffffff !important;
    font-size: 28px !important;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
@keyframes bunny-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(10px); }
}

/* ---------- Body content offset (since header is fixed) ---------- */
/* The masthead itself is still in flow with 100vh, so body layout stays correct.
   We only need to ensure the top bar sits above the video. */

/* ---------- Footer ---------- */
/* nothing extra; parent theme footer already cleaned by remove_action */
/* Patch v1.1.1 */
#site-title a::before, #site-title a::after { display: none !important; content: none !important; }
#masthead .menu-burger { display: none !important; }
#masthead #header-menu { display: none !important; }
#masthead .site-header-top { display: none !important; }
#masthead #access { display: flex !important; align-items: center; }
#masthead #access ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
#masthead #access ul li { margin: 0; padding: 0; }
#masthead #access ul li a { padding: 8px 14px !important; display: inline-block; }
#masthead .meta-arrow { width: auto !important; height: auto !important; text-align: center; }
#branding { padding-left: 8px !important; }
/* Patch v1.1.2 - shrink header height */
#masthead .site-header-bottom,
#masthead .site-header-bottom-fixed { min-height: 56px !important; height: 56px !important; }
#masthead .site-header-bottom-fixed .site-header-inside { min-height: 56px !important; height: 56px !important; padding: 0 !important; }
#masthead #site-header-main { min-height: 56px !important; max-height: 56px !important; }
/* Patch v1.2.0 - center big title, transparent top bar */

/* 1. Top bar: fully transparent, no blur, no border */
#masthead #site-header-main {
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* 2. Hide small logo in top bar */
#masthead #branding,
#masthead #site-text,
#masthead #site-title {
    display: none !important;
}

/* 3. Show big centered BunnyBlog title in hero */
#masthead #header-image-main::before {
    content: "BunnyBlog";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.35);
    z-index: 3;
    pointer-events: none;
    white-space: nowrap;
}

/* 4. Nav links: keep white with stronger shadow since no bg anymore */
#masthead #access a,
#masthead #header-menu a {
    color: rgba(255,255,255,0.95) !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.4) !important;
}

/* ============================================================
   Patch v1.3.0 - Curtain scroll effect (content slides up over fixed hero)
   ============================================================ */

/* 1. Hero (masthead) becomes a fixed, full-viewport stage */
#masthead {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100vh !important;
  min-height: 100vh !important;
  z-index: 1;
  overflow: hidden;
}

/* Ensure the video fills the fixed hero */
#masthead #header-image-main,
#masthead #header-image-main-inside {
  height: 100vh !important;
  min-height: 100vh !important;
}

#bunny-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
}

/* 2. Reserve viewport space so #content starts below the hero,
      then content slides up over the fixed hero as the user scrolls. */
#content {
  position: relative;
  margin-top: 100vh;
  z-index: 2;
  background: #ffffff;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.28), 0 -2px 8px rgba(0, 0, 0, 0.12);
  padding-top: 48px;
  /* Smooth the leading edge with a subtle gradient strip */
}

/* 3. Let the footer sit on top of the hero too (so bottom feels solid) */
#colophon,
.site-footer {
  position: relative;
  z-index: 2;
  background: #1a1a1a;
}

/* 4. Nudge the scroll arrow to the fixed hero */
#bunny-scroll-indicator {
  position: fixed;
  bottom: 32px;
  z-index: 3;
}

/* 5. On mobile, keep the effect but slightly softer radius */
@media (max-width: 768px) {
  #content {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding-top: 32px;
  }
}

/* ============================================================
   Patch v1.3.1 - Fix curtain: footer coverage + arrow only on hero
   ============================================================ */

/* Ensure the real footer (#footer) sits on top of the fixed hero */
#footer {
  position: relative !important;
  z-index: 2 !important;
  background: #1a1a1a;
  color: rgba(255,255,255,0.75);
}
#footer a { color: rgba(255,255,255,0.85); }
#footer #site-copyright { color: rgba(255,255,255,0.7); }

/* Hide the theme's built-in meta-arrow only AFTER scrolling past hero.
   It's inside masthead (fixed), so it stays visible at bottom of every screen.
   Solution: hide it once the user has scrolled. */
body.has-scrolled #masthead .meta-arrow {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#masthead .meta-arrow {
  transition: opacity 0.4s ease;
}

/* Safety: if toTop button exists, keep it above the fixed hero */
#toTop {
  z-index: 300 !important;
}

/* ============================================================
   Patch v1.4.0 - Article page: hero shrink + reading typography + progress bar
   ============================================================ */

/* === 1. Single/Page: shrink the fixed hero to a compact header (no 100vh) === */
body.single #masthead,
body.page #masthead,
body.archive #masthead,
body.category #masthead,
body.search #masthead {
  position: relative !important;
  height: 360px !important;
  min-height: 360px !important;
}
body.single #masthead #header-image-main,
body.page #masthead #header-image-main,
body.archive #masthead #header-image-main,
body.category #masthead #header-image-main,
body.search #masthead #header-image-main {
  height: 360px !important;
  min-height: 360px !important;
}
body.single #bunny-bg-video,
body.page #bunny-bg-video,
body.archive #bunny-bg-video,
body.category #bunny-bg-video,
body.search #bunny-bg-video {
  height: 360px;
  filter: brightness(0.78);
}
/* On non-home pages, don't leave margin-top: 100vh on content */
body.single #content,
body.page #content,
body.archive #content,
body.category #content,
body.search #content {
  margin-top: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  box-shadow: none !important;
  padding-top: 0 !important;
}
/* Hide the center "BunnyBlog" title on article pages */
body.single #masthead #header-image-main::before,
body.page #masthead #header-image-main::before,
body.archive #masthead #header-image-main::before,
body.category #masthead #header-image-main::before,
body.search #masthead #header-image-main::before {
  display: none !important;
}
/* Hide meta-arrow on non-home */
body.single #masthead .meta-arrow,
body.page #masthead .meta-arrow,
body.archive #masthead .meta-arrow,
body.category #masthead .meta-arrow,
body.search #masthead .meta-arrow {
  display: none !important;
}

/* Subtle dark overlay on the hero for text legibility */
body.single #masthead #header-image-main::after,
body.page #masthead #header-image-main::after,
body.archive #masthead #header-image-main::after,
body.category #masthead #header-image-main::after,
body.search #masthead #header-image-main::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%);
  z-index: 1;
  pointer-events: none;
}

/* === 2. Inject article title + meta INTO the hero via client-side (styled here) === */
.bunny-article-hero {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 36px;
  z-index: 3;
  padding: 0 32px;
  max-width: 900px;
  margin: 0 auto;
  color: #fff;
  text-align: center;
  pointer-events: none;
}
.bunny-article-hero .bunny-categ {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
  pointer-events: auto;
}
.bunny-article-hero .bunny-title {
  font-family: "Playfair Display", "Noto Serif SC", Georgia, serif;
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 14px 0;
  color: #fff;
  text-shadow: 0 3px 16px rgba(0,0,0,0.45);
}
.bunny-article-hero .bunny-meta {
  font-size: 13.5px;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.04em;
}
.bunny-article-hero .bunny-meta span + span::before {
  content: " · ";
  margin: 0 6px;
  color: rgba(255,255,255,0.55);
}

/* Hide the theme's default in-content title/meta to avoid duplication */
body.single .article-inner > header,
body.page .article-inner > header {
  display: none !important;
}

/* === 3. Reading typography: width, font, spacing, headings, images, quotes === */
body.single .entry-content,
body.page .entry-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.9;
  color: #2a2a2a;
  font-family: "Noto Serif SC", "Source Han Serif SC", "PingFang SC",
               -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  padding: 16px 0 40px;
}
body.single .entry-content p,
body.page .entry-content p {
  margin: 0 0 1.4em;
}
/* Monospace for code/math inline in Latin chars */
body.single .entry-content code,
body.page .entry-content code {
  font-family: "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #f4f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  color: #d63384;
}
body.single .entry-content pre,
body.page .entry-content pre {
  background: #1e1e2e;
  color: #f8f8f2;
  padding: 18px 22px;
  border-radius: 10px;
  overflow-x: auto;
  font-family: "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 14.5px;
  line-height: 1.65;
  margin: 1.6em 0;
}

/* Heading hierarchy inside article */
body.single .entry-content h1,
body.page .entry-content h1,
body.single .entry-content h2,
body.page .entry-content h2 {
  font-family: "Playfair Display", "Noto Serif SC", Georgia, serif;
  font-size: 1.7em;
  font-weight: 700;
  line-height: 1.35;
  margin: 2em 0 0.7em;
  padding-left: 14px;
  border-left: 4px solid #e9b44c;
  color: #1a1a1a;
}
body.single .entry-content h3,
body.page .entry-content h3 {
  font-size: 1.32em;
  font-weight: 700;
  line-height: 1.4;
  margin: 1.8em 0 0.6em;
  color: #1a1a1a;
}
body.single .entry-content h4,
body.page .entry-content h4 {
  font-size: 1.1em;
  font-weight: 700;
  margin: 1.6em 0 0.5em;
  color: #333;
}

/* Images: center, max-width, rounded, shadow */
body.single .entry-content img,
body.page .entry-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8em auto;
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.1);
}
body.single .entry-content figure,
body.page .entry-content figure {
  margin: 1.8em auto;
  text-align: center;
}
body.single .entry-content figcaption,
body.page .entry-content figcaption {
  font-size: 13.5px;
  color: #888;
  margin-top: 10px;
  text-align: center;
}

/* Blockquote */
body.single .entry-content blockquote,
body.page .entry-content blockquote {
  border-left: 4px solid #e9b44c;
  background: #fafaf6;
  padding: 18px 22px;
  margin: 1.8em 0;
  color: #555;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}
body.single .entry-content blockquote p,
body.page .entry-content blockquote p {
  margin: 0.3em 0;
}

/* Lists */
body.single .entry-content ul,
body.page .entry-content ul,
body.single .entry-content ol,
body.page .entry-content ol {
  padding-left: 1.5em;
  margin: 1em 0;
}
body.single .entry-content li,
body.page .entry-content li {
  margin: 0.4em 0;
}

/* Tighten sidebar next to reading column */
body.single #secondary,
body.page #secondary {
  font-size: 14.5px;
}

/* === 4. Reading progress bar (fixed top, above everything) === */
#bunny-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, #e9b44c 0%, #f5d76e 100%);
  z-index: 9999;
  pointer-events: none;
  transition: width 0.08s linear;
}
/* Offset progress bar below the WP admin bar if present */
body.admin-bar #bunny-progress {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar #bunny-progress { top: 46px; }
}

/* ============================================================
   Patch v1.5.0 - Paged listing (page 2+): shrink hero, remove curtain
   ============================================================ */

/* When on /page/N/ where N >= 2, collapse the hero and restore normal flow */
body.paged #masthead {
  position: relative !important;
  height: 360px !important;
  min-height: 360px !important;
}
body.paged #masthead #header-image-main,
body.paged #masthead #header-image-main-inside {
  height: 360px !important;
  min-height: 360px !important;
}
body.paged #bunny-bg-video {
  height: 360px;
  filter: brightness(0.78);
}

/* Cancel home-page curtain effect (no margin-top:100vh, no rounded top) */
body.paged #content {
  margin-top: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  box-shadow: none !important;
  padding-top: 0 !important;
}

/* Replace the giant "BunnyBlog" center title with a compact page label */
body.paged #masthead #header-image-main::before {
  content: "文章列表 · 第 " counter(page-num) " 页" !important;
  font-size: clamp(24px, 3vw, 36px) !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 16px rgba(0,0,0,0.45);
}
/* Use CSS counter trick with data attribute fallback via JS (below) for page number.
   Fallback static text in case JS doesn't run: */
body.paged #masthead #header-image-main::before {
  content: "文章列表" !important;
}

/* Dark overlay for legibility (same as article hero) */
body.paged #masthead #header-image-main::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Hide the scroll-down arrow on paged views */
body.paged #masthead .meta-arrow {
  display: none !important;
}

/* Show a small page badge below the big label via ::before on nav-paged */
body.paged .bunny-page-badge {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 36px);
  z-index: 3;
  text-align: center;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

/* ============================================================
   Patch v1.6.0 - Category / Tag / Archive page hero
   ============================================================ */

/* Hide the theme's default page-header (we'll show title in hero instead) */
body.archive .page-header,
body.category .page-header,
body.tag .page-header,
body.search .page-header {
  display: none !important;
}

/* Category hero block (injected via JS) */
.bunny-archive-hero {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 36px;
  z-index: 3;
  padding: 0 32px;
  max-width: 900px;
  margin: 0 auto;
  color: #fff;
  text-align: center;
  pointer-events: none;
}
.bunny-archive-hero .bunny-arch-eyebrow {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.bunny-archive-hero .bunny-arch-title {
  font-family: "Playfair Display", "Noto Serif SC", Georgia, serif;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 12px 0;
  color: #fff;
  text-shadow: 0 3px 16px rgba(0,0,0,0.45);
}
.bunny-archive-hero .bunny-arch-meta {
  font-size: 14px;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.05em;
}
.bunny-archive-hero .bunny-arch-meta span + span::before {
  content: " · ";
  margin: 0 6px;
  color: rgba(255,255,255,0.55);
}
.bunny-archive-hero .bunny-arch-desc {
  max-width: 560px;
  margin: 8px auto 0;
  font-size: 14px;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}

/* Override the generic .paged "文章列表" label on archive pages so it's not shown twice
   (paged rules from v1.5.0 + archive rules here – archive wins because we hide ::before) */
body.archive #masthead #header-image-main::before,
body.category #masthead #header-image-main::before,
body.tag #masthead #header-image-main::before,
body.search #masthead #header-image-main::before {
  display: none !important;
}
body.archive .bunny-page-badge,
body.category .bunny-page-badge,
body.tag .bunny-page-badge,
body.search .bunny-page-badge {
  display: none !important;
}

/* =========================================================
   PATCH v1.7.0 — 顶部"文章分类"下拉菜单
   ========================================================= */

#access #top-nav { position: relative; overflow: visible !important; }
#access #top-nav > li { position: relative; }

/* 触发器 a + 小三角 */
#access #top-nav > li.bunny-has-sub > a { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
#access #top-nav > li.bunny-has-sub .bunny-caret {
    font-style: normal;
    font-size: 11px;
    opacity: .75;
    transform: translateY(1px);
    transition: transform .25s ease;
}
#access #top-nav > li.bunny-has-sub:hover .bunny-caret,
#access #top-nav > li.bunny-has-sub:focus-within .bunny-caret { transform: translateY(1px) rotate(180deg); }

/* 子菜单面板 */
#access #top-nav .bunny-submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 6px);
    min-width: 220px;
    max-height: 60vh;
    overflow-y: auto;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: rgba(22, 22, 26, .92);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    z-index: 9999;
}
#access #top-nav > li.bunny-has-sub:hover > .bunny-submenu,
#access #top-nav > li.bunny-has-sub:focus-within > .bunny-submenu {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

/* hover 桥接区，避免从触发器移到面板时瞬间丢失 */
#access #top-nav > li.bunny-has-sub > .bunny-submenu::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -10px;
    height: 10px;
}

#access #top-nav .bunny-submenu li { margin: 0; padding: 0; }
#access #top-nav .bunny-submenu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 18px;
    color: rgba(255,255,255,.88);
    font-size: 14px;
    letter-spacing: .02em;
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s ease, color .18s ease, padding-left .18s ease;
}
#access #top-nav .bunny-submenu a:hover {
    background: rgba(233, 180, 76, .14);
    color: #f5d58a;
    padding-left: 22px;
}
#access #top-nav .bunny-submenu .bc-name { flex: 1; }
#access #top-nav .bunny-submenu .bc-count {
    margin-left: 14px;
    font-size: 11px;
    color: rgba(255,255,255,.42);
    background: rgba(255,255,255,.06);
    padding: 1px 8px;
    border-radius: 10px;
}
#access #top-nav .bunny-submenu a:hover .bc-count {
    color: #f5d58a;
    background: rgba(233, 180, 76, .18);
}

/* 手机端：禁用浮层，改为展开式 */
@media (max-width: 768px) {
    #access #top-nav .bunny-submenu {
        position: static;
        transform: none;
        opacity: 1;
        pointer-events: auto;
        background: transparent;
        backdrop-filter: none;
        border: 0;
        box-shadow: none;
        padding: 4px 0 8px;
        max-height: none;
    }
    #access #top-nav .bunny-submenu a { padding-left: 32px; }
    #access #top-nav > li.bunny-has-sub .bunny-caret { display: none; }
}

/* =========================================================
   PATCH v1.7.1 — 修正: 隐藏 #mobile-nav 里的下拉，避免在桌面端出现错位横条
   ========================================================= */

/* 桌面端: 移动菜单里的 li.bunny-has-sub 的子菜单完全不显示 */
#mobile-nav .bunny-submenu { display: none; }
#mobile-nav .bunny-has-sub > a .bunny-caret { display: none; }
#mobile-nav .bunny-has-sub > a[onclick] { pointer-events: none; }
/* 移动菜单里的"文章分类"条目直接隐藏，因为移动端侧边栏主题自己有分类列表；若你要，也可以保留只隐藏子菜单。
   这里选择隐藏整个条目，保持移动端干净 */
#mobile-nav li.bunny-has-sub { display: none; }

/* 手机视口 ≤ 768px: 还原显示，作为可展开分类列表 */
@media (max-width: 768px) {
    #mobile-nav li.bunny-has-sub { display: block; }
    #mobile-nav .bunny-submenu {
        display: block;
        list-style: none;
        margin: 4px 0 8px;
        padding: 0;
    }
    #mobile-nav .bunny-submenu a {
        display: flex;
        justify-content: space-between;
        padding: 6px 0 6px 24px;
        color: inherit;
        text-decoration: none;
        font-size: 14px;
        opacity: .85;
    }
    #mobile-nav .bunny-submenu .bc-count {
        font-size: 11px;
        opacity: .6;
    }
}

/* =========================================================
   PATCH v1.7.2 — 修正: 主题把 #top-nav li 内部设为 flex，需强制 submenu 为 block
   ========================================================= */
#access #top-nav .bunny-submenu { display: block !important; flex: none !important; width: auto !important; }
#access #top-nav .bunny-submenu li { display: block !important; flex: none !important; width: auto !important; }

/* 触发器自身的 flex 也要保证不会让 <ul> 成为 flex 子项被拉伸: */
#access #top-nav > li.bunny-has-sub { display: inline-block; }
#access #top-nav > li.bunny-has-sub > a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* =========================================================
   PATCH v1.7.3 — 微调: 下拉行距紧凑 + 清除主题干扰
   ========================================================= */
#access #top-nav .bunny-submenu li { margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
#access #top-nav .bunny-submenu li::before, #access #top-nav .bunny-submenu li::after { display: none !important; content: none !important; }
#access #top-nav .bunny-submenu a {
    padding: 8px 18px !important;
    color: rgba(255,255,255,.88) !important;
    text-transform: none !important;
    letter-spacing: .02em !important;
    font-weight: 400 !important;
}
#access #top-nav .bunny-submenu a:hover {
    background: rgba(233, 180, 76, .18) !important;
    color: #f5d58a !important;
}
/* 让面板从"文章分类"的左对齐开始，避免左偏出屏 */
#access #top-nav .bunny-submenu {
    left: 0 !important;
    transform: translate(0, 6px) !important;
}
#access #top-nav > li.bunny-has-sub:hover > .bunny-submenu,
#access #top-nav > li.bunny-has-sub:focus-within > .bunny-submenu {
    transform: translate(0, 0) !important;
}

/* v1.7.4: 覆盖主题顶部菜单 a 的大行高，让子菜单行距紧凑 */
#access #top-nav .bunny-submenu a { line-height: 1.5 !important; height: auto !important; font-size: 14px !important; }
