/* ============================================================
   爆更兔 · 顶部导航全局固定样式（全站统一）
   - 每个栏目颜色固定，不随当前页切换变黑
   - 首页固定黑色；其余栏目固定各自品牌色
   - 尺寸 / 间距 / 圆角 / 对齐全站一致
   ============================================================ */

/* ---------- 固定颜色（静态页 .topnav 与 SPA .sw-nav 通用） ---------- */
/* 首页：固定黑色 */
.topnav a[href="/home.html"],
.sw-nav a[href="/home.html"], .sw-nav a[href="/home"], .sw-nav a[href="/"] {
  background: linear-gradient(135deg,#1f2329,#3a3f47) !important;
}
/* AI创造：红 */
.topnav a[href="/books.html"], .topnav a[href="/books"],
.sw-nav a[href="/books.html"], .sw-nav a[href="/books"] {
  background: linear-gradient(135deg,#e64340,#d43b38) !important;
}
/* 当红书榜：紫粉 */
.topnav a[href="/hot-rank.html"], .topnav a[href="/hot-rank"],
.sw-nav a[href="/hot-rank.html"], .sw-nav a[href="/hot-rank"] {
  background: linear-gradient(135deg,#b06a8e,#9a5577) !important;
}
/* 灵感生成：粉 */
.topnav a[href="/inspiration.html"], .topnav a[href="/inspiration"],
.sw-nav a[href="/inspiration.html"], .sw-nav a[href="/inspiration"] {
  background: linear-gradient(135deg,#d05a8a,#b84773) !important;
}
/* 一键拆书：绿 */
.topnav a[href="/deconstruct"], .topnav a[href="/analyze.html"],
.sw-nav a[href="/deconstruct"], .sw-nav a[href="/analyze.html"] {
  background: linear-gradient(135deg,#6f9e7a,#578a65) !important;
}
/* 小说蒸馏：紫 */
.topnav a[href="/distill.html"], .topnav a[href="/distill"],
.sw-nav a[href="/distill.html"], .sw-nav a[href="/distill"] {
  background: linear-gradient(135deg,#9b59b6,#8e44ad) !important;
}
/* 降AI率：蓝紫 */
.topnav a[href="/optimization.html"], .topnav a[href="/optimization"],
.sw-nav a[href="/optimization.html"], .sw-nav a[href="/optimization"] {
  background: linear-gradient(135deg,#7d8fc4,#6678a8) !important;
}
/* AI漫剧：青绿 */
.topnav a[href="/video-create.html"], .topnav a[href="/video-create"],
.sw-nav a[href="/video-create.html"], .sw-nav a[href="/video-create"] {
  background: linear-gradient(135deg,#2fb58e,#1f9d78) !important;
}
/* 论坛：淡紫 */
.topnav a[href="/forum.html"], .topnav a[href="/forum"],
.sw-nav a[href="/forum.html"], .sw-nav a[href="/forum"] {
  background: linear-gradient(135deg,#8a7bb5,#72639c) !important;
}
/* 开放 API：橙金 */
.topnav a[href="/api.html"], .topnav a[href="/api"],
.sw-nav a[href="/api.html"], .sw-nav a[href="/api"] {
  background: linear-gradient(135deg,#e8a33d,#c9822a) !important;
}
/* 会员中心：紫 */
.topnav a[href="/member"], .sw-nav a[href="/member"] {
  background: linear-gradient(135deg,#7b5ce0,#5b3fb8) !important;
}
/* 设置 / 墨客：蓝灰 */
.topnav a[href="/settings"], .sw-nav a[href="/settings"] {
  background: linear-gradient(135deg,#5f8f9e,#4a7585) !important;
}

/* ---------- 当前页：不再变黑，保持固定色 + 白色内描边标识 ---------- */
.topnav a.on, .sw-nav a.on, .sw-nav a.nav.on {
  background: inherit !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.92), 0 3px 9px rgba(0,0,0,.22) !important;
}
/* 让 .on 沿用各自固定渐变（inherit 在渐变上不可靠，逐条兜底） */
.topnav a[href="/home.html"].on, .sw-nav a[href="/home.html"].on { background: linear-gradient(135deg,#1f2329,#3a3f47) !important; }
.topnav a[href="/books.html"].on, .topnav a[href="/books"].on,
.sw-nav a[href="/books.html"].on, .sw-nav a[href="/books"].on { background: linear-gradient(135deg,#e64340,#d43b38) !important; }
.topnav a[href="/hot-rank.html"].on, .topnav a[href="/hot-rank"].on,
.sw-nav a[href="/hot-rank.html"].on, .sw-nav a[href="/hot-rank"].on { background: linear-gradient(135deg,#b06a8e,#9a5577) !important; }
.topnav a[href="/inspiration.html"].on, .topnav a[href="/inspiration"].on,
.sw-nav a[href="/inspiration.html"].on, .sw-nav a[href="/inspiration"].on { background: linear-gradient(135deg,#d05a8a,#b84773) !important; }
.topnav a[href="/deconstruct"].on, .topnav a[href="/analyze.html"].on,
.sw-nav a[href="/deconstruct"].on, .sw-nav a[href="/analyze.html"].on { background: linear-gradient(135deg,#6f9e7a,#578a65) !important; }
.topnav a[href="/distill.html"].on, .topnav a[href="/distill"].on,
.sw-nav a[href="/distill.html"].on, .sw-nav a[href="/distill"].on { background: linear-gradient(135deg,#9b59b6,#8e44ad) !important; }
.topnav a[href="/optimization.html"].on, .topnav a[href="/optimization"].on,
.sw-nav a[href="/optimization.html"].on, .sw-nav a[href="/optimization"].on { background: linear-gradient(135deg,#7d8fc4,#6678a8) !important; }
.topnav a[href="/video-create.html"].on, .topnav a[href="/video-create"].on,
.sw-nav a[href="/video-create.html"].on, .sw-nav a[href="/video-create"].on { background: linear-gradient(135deg,#2fb58e,#1f9d78) !important; }
.topnav a[href="/forum.html"].on, .topnav a[href="/forum"].on,
.sw-nav a[href="/forum.html"].on, .sw-nav a[href="/forum"].on { background: linear-gradient(135deg,#8a7bb5,#72639c) !important; }
.topnav a[href="/api.html"].on, .topnav a[href="/api"].on,
.sw-nav a[href="/api.html"].on, .sw-nav a[href="/api"].on { background: linear-gradient(135deg,#e8a33d,#c9822a) !important; }

/* ---------- 桌面端尺寸 / 间距 / 对齐统一（按首页标准） ---------- */
@media (min-width: 900px) {
  .topbar, .sw-topbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    max-width: 1080px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 16px 20px 4px !important;
    box-sizing: border-box !important;
  }
  .topnav, .sw-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
  }
  .topnav a, .sw-nav a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 36px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 1px !important;
    color: #fff !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.14) !important;
    transition: transform .15s, box-shadow .15s, filter .15s !important;
    box-sizing: border-box !important;
  }
  .brand, .sw-brand {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    white-space: nowrap !important;
  }
  .brand .logo, .sw-brand .logo { width: 34px !important; height: 34px !important; flex: none !important; }
}

/* hover 微动效（不变色） */
.topnav a:hover, .sw-nav a:hover {
  filter: brightness(1.08) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 10px rgba(0,0,0,.18) !important;
  color: #fff !important;
}
