/* 光说不练 · navigater.lfvculture.com · 现代清爽全宽导航布局
   主题：html[data-theme="light"|"dark"]，变量全部在此定义，nav-auth.css 复用。
   设计基调：低饱和画布 + 白色浮层 + 单一蓝色强调；圆角 16/12/10 三档；留白优先。 */
:root {
    color-scheme: light;
    --nav-bg: #f4f7fc;
    --nav-bg-deep: #edf2fa;
    --nav-surface: #ffffff;
    --nav-surface-2: #f7f9fd;
    --nav-elev: #ffffff;
    --nav-input-bg: #f3f6fb;
    --nav-topbar-bg: rgba(255, 255, 255, .82);
    --nav-ink: #141c2b;
    --nav-ink-soft: #58647a;
    --nav-ink-faint: #6f7d92;
    --nav-ink-muted: #5f6c83;
    --nav-line: #e4eaf3;
    --nav-line-soft: #edf1f8;
    --nav-hover-line: #ccd8e9;
    --nav-accent: #2f6bff;
    --nav-primary: #2f6bff;
    --nav-primary-hover: #2459df;
    --nav-accent-hover: #2459df;
    --nav-accent-soft: #eaf1ff;
    --nav-accent-ring: rgba(47, 107, 255, .14);
    --nav-danger: #e5484d;
    --nav-ok: #0f9d68;
    --nav-mask: rgba(14, 21, 38, .48);
    --nav-edit-bg: #fff8e8;
    --nav-edit-line: #f4dfb2;
    --nav-edit-ink: #8a6208;
    --nav-glow: radial-gradient(920px 420px at 50% -8%, rgba(197, 216, 255, .55) 0%, rgba(197, 216, 255, 0) 70%);
    --nav-grad: linear-gradient(135deg, #3b72ff 0%, #6a4bff 100%);
    --nav-grad-btn: linear-gradient(135deg, #2f6bff 0%, #5b5cff 100%);
    --nav-footer-bg: linear-gradient(180deg, #f7faff 0%, #e9f0fb 100%);
    --nav-radius: 16px;
    --nav-radius-sm: 10px;
    --nav-radius-lg: 20px;
    --nav-shadow: 0 1px 2px rgba(18, 30, 58, .04), 0 6px 18px rgba(18, 30, 58, .05);
    --nav-shadow-hover: 0 2px 6px rgba(18, 30, 58, .06), 0 18px 38px rgba(18, 30, 58, .10);
    --nav-shadow-auth: 0 1px 2px rgba(18, 30, 58, .04), 0 24px 64px rgba(18, 30, 58, .10);
    --nav-shadow-accent: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 16px rgba(47, 107, 255, .28);
    --nav-shadow-btn: 0 6px 16px rgba(47, 107, 255, .26);
    --nav-topbar-h: 66px;
    --nav-sidebar-w: 266px;
    --nav-cpad-x: clamp(24px, 3vw, 44px);
    --nav-content-max: 1200px;
    --nav-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ── 黑暗模式：覆盖整套变量 ─────────────────── */
html[data-theme="dark"] {
    color-scheme: dark;
    --nav-bg: #080d15;
    --nav-bg-deep: #060a11;
    --nav-surface: #101823;
    --nav-surface-2: #0c131d;
    --nav-elev: #18222f;
    --nav-input-bg: #0c131d;
    --nav-topbar-bg: rgba(9, 14, 23, .78);
    --nav-ink: #e8eef9;
    --nav-ink-soft: #aebbd0;
    --nav-ink-faint: #8b9ab0;
    --nav-ink-muted: #97a6bc;
    --nav-line: #1e2a3a;
    --nav-line-soft: #18222f;
    --nav-hover-line: #304158;
    --nav-accent: #6f9bff;
    --nav-primary: #3d6fe8;
    --nav-primary-hover: #5285f5;
    --nav-accent-hover: #8db0ff;
    --nav-accent-soft: rgba(111, 155, 255, .14);
    --nav-accent-ring: rgba(111, 155, 255, .2);
    --nav-danger: #ff8080;
    --nav-ok: #4fe0a0;
    --nav-mask: rgba(2, 6, 12, .66);
    --nav-edit-bg: #241d0e;
    --nav-edit-line: #44360f;
    --nav-edit-ink: #f2c473;
    --nav-glow: radial-gradient(920px 420px at 50% -8%, rgba(74, 110, 220, .18) 0%, rgba(74, 110, 220, 0) 70%);
    --nav-grad: linear-gradient(135deg, #4f7dff 0%, #8a5cff 100%);
    --nav-grad-btn: linear-gradient(135deg, #3f6fe6 0%, #6a4fe0 100%);
    --nav-footer-bg: linear-gradient(180deg, #0c131e 0%, #080d15 100%);
    --nav-shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 10px 26px rgba(0, 0, 0, .38);
    --nav-shadow-hover: 0 4px 12px rgba(0, 0, 0, .5), 0 20px 44px rgba(0, 0, 0, .5);
    --nav-shadow-auth: 0 1px 2px rgba(0, 0, 0, .5), 0 24px 64px rgba(0, 0, 0, .55);
    --nav-shadow-accent: inset 0 1px 0 rgba(255, 255, 255, .16), 0 6px 16px rgba(79, 125, 255, .3);
    --nav-shadow-btn: 0 6px 16px rgba(79, 125, 255, .24);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--nav-font);
    background: var(--nav-bg);
    color: var(--nav-ink);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color .2s ease, color .2s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
svg { flex: 0 0 auto; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--nav-accent);
    outline-offset: 2px;
}
::selection { background: var(--nav-accent-soft); color: var(--nav-accent); }

/* ── 顶部菜单栏 ───────────────────────────── */
.nav-topbar {
    position: sticky; top: 0; z-index: 50;
    height: var(--nav-topbar-h);
    display: flex; align-items: center; gap: 22px;
    padding: 0 28px;
    background: var(--nav-topbar-bg);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--nav-line-soft);
    box-shadow: 0 1px 0 rgba(18, 30, 58, .02);
}
.nav-brand { display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.nav-brand .nav-logo {
    width: 38px; height: 38px; border-radius: 12px;
    background: var(--nav-grad);
    color: #fff; display: grid; place-items: center;
    font-size: 18px; font-weight: 800; line-height: 1;
    box-shadow: var(--nav-shadow-accent);
}
.nav-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.nav-brand-name { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.nav-brand small, .nav-brand-sub {
    font-weight: 600; color: var(--nav-ink-faint);
    font-size: 9.5px; letter-spacing: 2px; text-transform: uppercase;
    margin-top: 1px;
}

.nav-search { flex: 1; max-width: 560px; position: relative; min-width: 0; }
.nav-search input {
    width: 100%; height: 46px; border: 1px solid var(--nav-line); border-radius: 14px;
    padding: 0 46px 0 44px; font-size: 14px; background: var(--nav-input-bg); color: var(--nav-ink);
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.nav-search input::placeholder { color: var(--nav-ink-faint); }
.nav-search input:hover { border-color: var(--nav-hover-line); }
.nav-search input:focus {
    outline: none; border-color: var(--nav-accent); background: var(--nav-surface);
    box-shadow: 0 0 0 4px var(--nav-accent-ring), 0 8px 20px rgba(47, 107, 255, .08);
}
.nav-search .nav-search-ico {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--nav-ink-faint); pointer-events: none;
}
.nav-search input:focus ~ .nav-search-ico { color: var(--nav-accent); }
.nav-search-kbd {
    position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
    min-width: 22px; height: 22px; padding: 0 6px;
    display: grid; place-items: center;
    border: 1px solid var(--nav-line); border-radius: 7px;
    background: var(--nav-surface); color: var(--nav-ink-faint);
    font-family: inherit; font-size: 11px; line-height: 1; pointer-events: none;
}

.nav-top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
/* 导航首页：搜索框不再拉伸，主题键与右侧操作组一起靠右 */
.nav-topbar:not(.auth-topbar) .nav-top-actions { margin-left: 0; }
.nav-topbar:not(.auth-topbar) .nav-theme-toggle { margin-left: auto; }
.nav-auth-slot { display: inline-flex; align-items: center; gap: 10px; }
/* ── 账号区：只留头像按钮 + 下拉菜单（对齐主站 user-pop 交互） ── */
.nav-user-wrap { position: relative; display: inline-flex; align-items: center; }
.nav-avatar-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; background: none; border-radius: 14px;
    cursor: pointer; transition: transform .16s cubic-bezier(.2, .7, .3, 1);
}
.nav-avatar-btn:hover { transform: translateY(-1px); }
.nav-avatar-btn:active { transform: scale(.96); }
.nav-avatar-btn .nav-avatar {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px;
    background: var(--nav-grad-btn); color: #fff; font-size: 15px;
    box-shadow: var(--nav-shadow-btn);
    transition: box-shadow .18s ease;
}
.nav-avatar-btn .nav-avatar.is-guest {
    background: var(--nav-accent-soft); color: var(--nav-accent);
    box-shadow: inset 0 0 0 1px var(--nav-line);
}
.nav-avatar-btn[aria-expanded="true"] .nav-avatar {
    box-shadow: 0 0 0 4px var(--nav-accent-ring), var(--nav-shadow-btn);
}
.nav-user-pop {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 90;
    width: 248px; padding: 8px;
    background: var(--nav-elev); border: 1px solid var(--nav-line);
    border-radius: 16px; box-shadow: var(--nav-shadow-auth);
    opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top right;
    transition: opacity .17s ease, transform .17s ease;
    pointer-events: none;
}
.nav-user-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.nav-user-pop[hidden] { display: none; }
.up-head {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px 12px; margin-bottom: 6px;
    border-bottom: 1px solid var(--nav-line-soft);
}
.up-head-avatar {
    width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--nav-accent-soft); color: var(--nav-accent);
    font-size: 15px; font-weight: 700;
}
.up-head-body { min-width: 0; }
.up-name {
    font-size: 14px; font-weight: 600; color: var(--nav-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.up-sub { margin-top: 1px; font-size: 11.5px; color: var(--nav-ink-faint); }
.up-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; margin: 1px 0; border: 0; border-radius: 10px;
    background: none; color: var(--nav-ink-soft);
    font-family: inherit; font-size: 13.5px; font-weight: 500; text-align: left;
    transition: background .14s, color .14s;
}
.up-item:hover { background: var(--nav-surface-2); color: var(--nav-ink); }
.up-item svg { width: 16px; height: 16px; opacity: .78; }
.up-item-danger { color: var(--nav-danger); }
.up-item-danger:hover { background: rgba(229, 72, 77, .1); color: var(--nav-danger); }
html[data-theme="dark"] .up-item-danger:hover { background: rgba(255, 128, 128, .14); }
.up-sep { height: 1px; margin: 6px 8px; background: var(--nav-line-soft); }
.nav-btn-apply {
    border-color: var(--nav-accent); color: var(--nav-accent);
    background: var(--nav-accent-soft); font-weight: 600;
}
.nav-btn-apply:hover { background: var(--nav-accent); border-color: var(--nav-accent); color: #fff; }
.nav-btn-apply-plus { font-size: 15px; line-height: 1; }
.nav-btn-label-sm { display: none; }
/* ── 顶栏显式「编辑」入口：仅 admin/superadmin 显示 ── */
.nav-btn.nav-edit-entry {
    border-color: var(--nav-accent); color: var(--nav-accent);
    background: var(--nav-accent-soft); font-weight: 600; gap: 6px;
}
.nav-btn.nav-edit-entry:hover {
    background: var(--nav-accent); border-color: var(--nav-accent); color: #fff;
    box-shadow: 0 4px 14px var(--nav-accent-ring);
}
.nav-edit-entry-ico { width: 15px; height: 15px; }
.nav-btn.nav-edit-entry.is-active {
    background: var(--nav-grad-btn); border-color: transparent; color: #fff;
    box-shadow: var(--nav-shadow-btn);
}
.nav-btn.nav-edit-entry.is-active:hover { filter: brightness(1.04); color: #fff; }
.nav-edit-entry[hidden] { display: none; }
.nav-theme-toggle {
    width: 40px; height: 40px; flex: 0 0 40px; padding: 0;
    border-radius: 12px; border: 1px solid var(--nav-line);
    background: var(--nav-elev); color: var(--nav-ink-soft);
    display: grid; place-items: center;
    transition: color .16s, border-color .16s, background .16s, transform .2s;
}
.nav-theme-toggle:hover {
    color: var(--nav-accent); border-color: var(--nav-accent);
    background: var(--nav-accent-soft); transform: rotate(-10deg);
}
.nav-theme-toggle svg { display: block; }
.nav-btn {
    height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--nav-line);
    background: var(--nav-elev); color: var(--nav-ink); font-size: 14px; font-weight: 500;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    white-space: nowrap;
    transition: color .16s, border-color .16s, background .16s, box-shadow .16s, transform .12s;
}
.nav-btn:hover { border-color: var(--nav-accent); color: var(--nav-accent); box-shadow: 0 4px 12px rgba(18, 30, 58, .06); }
.nav-btn:active { transform: translateY(1px); }
.nav-btn-primary {
    background: var(--nav-grad-btn); border-color: transparent; color: #fff;
    box-shadow: var(--nav-shadow-btn);
}
.nav-btn-primary:hover { background: var(--nav-grad-btn); border-color: transparent; color: #fff; filter: brightness(1.04); }
.nav-avatar {
    width: 32px; height: 32px; border-radius: 10px; flex: 0 0 32px;
    background: var(--nav-accent-soft); color: var(--nav-accent);
    display: grid; place-items: center; font-weight: 700; font-size: 14px;
}

/* ── 主体：左侧边栏 + 右内容 ───────────────── */
.nav-shell { display: flex; align-items: flex-start; width: 100%; }
.nav-sidebar {
    width: var(--nav-sidebar-w); flex: 0 0 var(--nav-sidebar-w);
    position: sticky; top: var(--nav-topbar-h);
    height: calc(100vh - var(--nav-topbar-h));
    overflow-y: auto; padding: 20px 14px 36px;
    border-right: 1px solid var(--nav-line-soft); background: var(--nav-surface);
    scrollbar-width: thin; scrollbar-color: var(--nav-line) transparent;
}
.nav-side-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 700; letter-spacing: 1.8px;
    color: var(--nav-ink-faint); text-transform: uppercase;
    padding: 0 10px 10px;
}
.nav-side-title::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--nav-line), transparent);
}
.nav-cat { list-style: none; margin: 0; padding: 0; }
.nav-cat li { margin: 2px 0; }
.nav-cat-row {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px;
    padding: 7px 10px; border-radius: var(--nav-radius-sm); border: none; background: none;
    color: var(--nav-ink-soft); font-size: 14px; text-align: left;
    transition: background .14s, color .14s, box-shadow .14s;
}
.nav-cat-row:hover { background: var(--nav-surface-2); color: var(--nav-ink); }
.nav-cat-row:hover .nav-cat-ico { color: var(--nav-accent); }
.nav-cat-row.is-active {
    background: var(--nav-accent-soft); color: var(--nav-accent); font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(47, 107, 255, .1);
}
.nav-cat-row.is-active .nav-cat-ico {
    background: var(--nav-surface); color: var(--nav-accent);
    box-shadow: 0 2px 6px rgba(47, 107, 255, .14);
}
.nav-cat-row .nav-cat-ico {
    width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px;
    display: grid; place-items: center;
    color: var(--nav-ink-faint); font-size: 15px; background: transparent;
    transition: background .14s, color .14s, box-shadow .14s;
}
.nav-cat-row .nav-cat-ico svg { width: 16px; height: 16px; }
.nav-cat-row .nav-cat-emoji { font-size: 15px; line-height: 1; }
.nav-cat-row .nav-cat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-cat-row .nav-cat-count {
    min-width: 20px; padding: 1px 6px; border-radius: 999px;
    background: var(--nav-surface-2); color: var(--nav-ink-faint);
    font-size: 11px; font-weight: 600; text-align: center;
}
.nav-cat-row.is-active .nav-cat-count { background: var(--nav-surface); color: var(--nav-accent); }
.nav-cat-row .nav-caret {
    width: 14px; height: 14px; color: var(--nav-ink-faint);
    transition: transform .18s ease; opacity: .8;
}
.nav-cat-row.is-open .nav-caret { transform: rotate(90deg); }
.nav-cat-children {
    list-style: none; margin: 2px 0 4px 20px; padding: 0 0 0 8px;
    border-left: 1px solid var(--nav-line-soft); overflow: hidden;
}
.nav-cat-children .nav-cat-row { font-size: 13.5px; min-height: 34px; padding: 5px 8px; gap: 8px; }
.nav-cat-children .nav-cat-row .nav-cat-ico { width: 22px; height: 22px; flex: 0 0 22px; }
.nav-cat-children .nav-cat-row .nav-cat-ico svg { width: 14px; height: 14px; }
.nav-cat-children .nav-cat-children { margin-left: 14px; }
.nav-cat-children .nav-cat-children .nav-cat-row { font-size: 13px; color: var(--nav-ink-faint); }

/* ── 内容区 ──────────────────────────────── */
.nav-content {
    flex: 1; min-width: 0;
    padding: 30px var(--nav-cpad-x) 52px;
    background: var(--nav-glow) no-repeat top center / 100% 460px;
}
.nav-crumb {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
    font-size: 12.5px; color: var(--nav-ink-faint); margin-bottom: 10px;
}
.nav-crumb a { transition: color .14s; }
.nav-crumb a:hover { color: var(--nav-accent); }
.nav-crumb b { color: var(--nav-ink-soft); font-weight: 600; }
.nav-content-head { margin-bottom: 22px; }
.nav-content-head h1 {
    font-size: 28px; font-weight: 700; line-height: 1.25; letter-spacing: -.4px;
    margin: 0 0 7px;
}
.nav-content-head p { margin: 0; color: var(--nav-ink-soft); font-size: 14px; }
.nav-subchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }
.nav-section-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: -3px 0 16px; }
.nav-section-chips .nav-chip { padding: 4px 12px; font-size: 12.5px; }
.nav-chip {
    padding: 6px 14px; border-radius: 999px; border: 1px solid var(--nav-line);
    background: var(--nav-surface); font-size: 13px; color: var(--nav-ink-soft);
    display: inline-flex; align-items: center; gap: 6px;
    transition: color .15s, border-color .15s, background .15s, box-shadow .15s, transform .15s;
}
.nav-chip:hover {
    border-color: var(--nav-accent); color: var(--nav-accent);
    background: var(--nav-accent-soft); transform: translateY(-1px);
}
.nav-chip:active { transform: translateY(0); }
.nav-chip.is-active {
    background: var(--nav-grad-btn); border-color: transparent; color: #fff;
    box-shadow: var(--nav-shadow-btn);
}
.nav-chip-count {
    min-width: 16px; padding: 0 5px; border-radius: 999px;
    background: var(--nav-surface-2); color: var(--nav-ink-faint);
    font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center;
    transition: background .15s, color .15s;
}
.nav-chip.is-active .nav-chip-count { background: rgba(255, 255, 255, .22); color: #fff; }

/* 离屏懒渲染：section 与卡片都启用 content-visibility，长列表滚动只渲染视口附近 */
.nav-section {
    margin-bottom: 36px; scroll-margin-top: 18px;
    content-visibility: auto;
    contain-intrinsic-size: auto 900px;
}
.nav-section:last-child { margin-bottom: 0; }
.nav-section-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 17px; font-weight: 700; letter-spacing: -.2px;
    margin: 0 0 16px; color: var(--nav-ink);
}
.nav-section-ico {
    width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--nav-accent-soft); color: var(--nav-accent);
}
.nav-section-ico svg { width: 17px; height: 17px; }
.nav-section-ico .nav-cat-emoji { font-size: 15px; line-height: 1; }
.nav-section-count {
    margin-left: 2px; padding: 1px 9px; border-radius: 999px;
    background: var(--nav-surface-2); border: 1px solid var(--nav-line-soft);
    color: var(--nav-ink-faint); font-size: 11.5px; font-weight: 600; letter-spacing: 0;
}
.nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

/* ── 站点卡片 ────────────────────────────── */
.nav-card {
    position: relative; display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
    padding: 18px; overflow: hidden;
    background: var(--nav-surface);
    border: 1px solid var(--nav-line);
    border-radius: var(--nav-radius);
    box-shadow: var(--nav-shadow);
    cursor: pointer;
    transition: transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .2s, border-color .2s;
    content-visibility: auto;
    contain-intrinsic-size: auto 136px;
}
.nav-card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(300px 150px at 100% 0%, rgba(47, 107, 255, .1), transparent 72%);
    opacity: 0; transition: opacity .2s;
}
html[data-theme="dark"] .nav-card::after {
    background: radial-gradient(300px 150px at 100% 0%, rgba(111, 155, 255, .14), transparent 72%);
}
.nav-card:hover {
    transform: translateY(-4px);
    border-color: var(--nav-hover-line);
    box-shadow: var(--nav-shadow-hover);
}
.nav-card:hover::after { opacity: 1; }
.nav-card:active { transform: translateY(-1px); }
.nav-card-ico {
    width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px;
    background: var(--nav-surface-2);
    background: color-mix(in srgb, var(--card-accent, var(--nav-accent)) 9%, var(--nav-surface));
    border: 1px solid var(--nav-line-soft);
    border-color: color-mix(in srgb, var(--card-accent, var(--nav-accent)) 14%, var(--nav-line));
    display: grid; place-items: center; overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.nav-card:hover .nav-card-ico { transform: scale(1.04); box-shadow: 0 4px 12px rgba(18, 30, 58, .07); }
.nav-card-ico img { width: 32px; height: 32px; object-fit: contain; }
.nav-card-ico .nav-ico-fallback {
    font-size: 21px; font-weight: 700; line-height: 1;
    color: var(--card-accent, var(--nav-accent));
}
.nav-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; padding-top: 1px; }
.nav-card-title {
    font-size: 15.5px; font-weight: 600; line-height: 1.4; letter-spacing: -.1px;
    margin: 0; padding-right: 34px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.nav-editing .nav-card-title { padding-right: 0; }
.nav-card-desc {
    font-size: 13px; color: var(--nav-ink-soft); margin: 0;
    line-height: 1.55; min-height: 40px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nav-card-host {
    align-self: flex-start; margin-top: 2px;
    padding: 1px 8px; border-radius: 999px;
    background: var(--nav-surface-2); border: 1px solid var(--nav-line-soft);
    font-size: 11.5px; color: var(--nav-ink-faint); letter-spacing: .1px;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* ── 站点标签 chip（琥珀色警示风 · 浅/深双套，卡片与详情共用） ── */
.nav-card-tags {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    margin-top: 3px; min-width: 0;
}
.nav-tag-chip {
    display: inline-flex; align-items: center; gap: 4px;
    max-width: 100%; padding: 2px 9px 2px 7px;
    border-radius: 999px;
    background: #fff8e8;
    border: 1px solid #f4dfb2;
    color: #8a6208;
    font-size: 11.5px; font-weight: 600; line-height: 1.5; letter-spacing: .1px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
    white-space: nowrap;
}
.nav-tag-chip-ico { width: 12px; height: 12px; flex: 0 0 12px; opacity: .85; }
.nav-tag-chip-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-theme="dark"] .nav-tag-chip {
    background: rgba(242, 196, 115, .13);
    border-color: rgba(242, 196, 115, .32);
    color: #f2c473;
    box-shadow: none;
}
/* 首帧/脚本被拦时未落 data-theme，跟随系统深浅色 */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .nav-tag-chip {
        background: rgba(242, 196, 115, .13);
        border-color: rgba(242, 196, 115, .32);
        color: #f2c473;
        box-shadow: none;
    }
}
.nav-card-go {
    position: absolute; top: 14px; right: 14px;
    width: 26px; height: 26px; border-radius: 9px;
    display: grid; place-items: center;
    background: var(--nav-surface-2); color: var(--nav-ink-faint);
    opacity: 0; transform: translate(-5px, 5px);
    transition: opacity .2s, transform .2s, color .2s, background .2s;
}
.nav-card-go svg { width: 14px; height: 14px; }
.nav-card:hover .nav-card-go {
    opacity: 1; transform: none;
    color: var(--nav-accent); background: var(--nav-accent-soft);
}
body.nav-editing .nav-card-go { display: none; }

.nav-empty {
    text-align: center; padding: 64px 24px 72px;
    color: var(--nav-ink-faint); font-size: 14px;
}
.nav-empty .nav-empty-ico {
    width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px;
    display: grid; place-items: center; font-size: 28px;
    background: var(--nav-surface); border: 1px solid var(--nav-line);
    box-shadow: var(--nav-shadow); color: var(--nav-accent);
}
.nav-empty .nav-empty-ico svg { width: 28px; height: 28px; opacity: .85; }
.nav-empty-title { font-size: 15px; font-weight: 600; color: var(--nav-ink-soft); }
.nav-empty-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--nav-ink-faint); }
.nav-empty-hint a { color: var(--nav-accent); }
.nav-loading {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 80px 20px; color: var(--nav-ink-faint); font-size: 14px;
}
.nav-loading::before {
    content: ""; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--nav-line); border-top-color: var(--nav-accent);
    animation: navSpin .8s linear infinite;
}
@keyframes navSpin { to { transform: rotate(360deg); } }

/* 加载骨架：比纯 spinner 更有「内容快来了」的观感 */
.nav-skel-head { margin-bottom: 22px; }
.nav-skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.nav-skel-card {
    display: flex; align-items: flex-start; gap: 14px; padding: 18px;
    background: var(--nav-surface); border: 1px solid var(--nav-line);
    border-radius: var(--nav-radius); box-shadow: var(--nav-shadow);
}
.nav-skel {
    display: block; border-radius: 8px;
    background: linear-gradient(90deg, var(--nav-surface-2) 20%, var(--nav-line-soft) 38%, var(--nav-surface-2) 56%);
    background-size: 300% 100%;
    animation: navShimmer 1.5s ease-in-out infinite;
}
html[data-theme="dark"] .nav-skel {
    background: linear-gradient(90deg, var(--nav-surface-2) 20%, var(--nav-line) 38%, var(--nav-surface-2) 56%);
    background-size: 300% 100%;
}
@keyframes navShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.nav-skel-title { width: 180px; height: 22px; }
.nav-skel-sub { width: 120px; height: 12px; margin-top: 10px; }
.nav-skel-ico { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; }
.nav-skel-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; padding-top: 4px; }
.nav-skel-line { width: 100%; height: 12px; }
.nav-skel-line.is-short { width: 42%; }
.nav-skel-line.is-mid { width: 70%; }

/* ── 详情模态框 ──────────────────────────── */
.nav-modal-mask {
    position: fixed; inset: 0; z-index: 100; background: var(--nav-mask);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; padding: 24px;
}
.nav-modal-mask.is-open { display: flex; }
.nav-modal {
    width: 100%; max-width: 620px; max-height: 86vh; overflow-y: auto;
    background: var(--nav-surface); border: 1px solid var(--nav-line);
    border-radius: var(--nav-radius-lg);
    box-shadow: 0 24px 80px rgba(10, 20, 50, .28);
    animation: navPop .22s cubic-bezier(.2, .8, .3, 1);
}
html[data-theme="dark"] .nav-modal { box-shadow: 0 24px 80px rgba(0, 0, 0, .65); }
@keyframes navPop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.nav-modal-head { display: flex; gap: 16px; padding: 26px 28px 18px; align-items: flex-start; }
.nav-modal-ico {
    width: 58px; height: 58px; flex: 0 0 58px; border-radius: 16px;
    background: var(--nav-accent-soft); display: grid; place-items: center;
    border: 1px solid var(--nav-line-soft); overflow: hidden;
}
.nav-modal-ico img { width: 38px; height: 38px; object-fit: contain; }
.nav-modal-ico .nav-ico-fallback { font-size: 25px; font-weight: 700; color: var(--nav-accent); }
.nav-modal-titles { flex: 1; min-width: 0; }
.nav-modal-titles h2 { margin: 0 0 7px; font-size: 21px; font-weight: 700; line-height: 1.35; letter-spacing: -.2px; }
.nav-modal-cat {
    font-size: 12px; color: var(--nav-accent); background: var(--nav-accent-soft);
    padding: 3px 11px; border-radius: 999px; display: inline-block;
}
.nav-modal-close {
    border: none; background: var(--nav-surface-2); width: 34px; height: 34px;
    border-radius: 10px; font-size: 16px; color: var(--nav-ink-soft); flex: 0 0 34px;
    transition: background .15s, color .15s;
}
.nav-modal-close:hover { background: var(--nav-line); color: var(--nav-ink); }
.nav-modal-body { padding: 0 28px 8px; }
.nav-modal-desc { font-size: 15px; color: var(--nav-ink-soft); margin: 0 0 16px; }
.nav-modal-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: -6px 0 16px; }
.nav-modal-tags:empty { display: none; margin: 0; }
.nav-modal-tags .nav-tag-chip { font-size: 12px; padding: 3px 11px 3px 9px; }
.nav-modal-tags .nav-tag-chip-ico { width: 13px; height: 13px; flex-basis: 13px; }
.nav-modal-detail {
    font-size: 14.5px; color: var(--nav-ink); line-height: 1.8;
    border-top: 1px solid var(--nav-line-soft); padding-top: 16px;
}
.nav-modal-detail:empty { display: none; }
.nav-modal-foot { padding: 20px 28px 26px; display: flex; gap: 12px; align-items: center; }
.nav-modal-url { flex: 1; font-size: 12.5px; color: var(--nav-ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-visit {
    height: 44px; padding: 0 26px; border-radius: 12px;
    background: var(--nav-grad-btn); color: #fff; border: none;
    font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
    box-shadow: var(--nav-shadow-btn); transition: filter .16s, transform .12s;
}
.nav-visit:hover { filter: brightness(1.05); }
.nav-visit:active { transform: translateY(1px); }

/* ── 添加网站模态框（超管 · 页面内） ───────── */
.nav-modal-form { max-width: 660px; max-height: calc(100vh - 40px); }
/* 表单较长时让操作按钮常驻模态框底部，避免「保存」被滚出视口 */
.nav-modal-form .nav-form-actions {
    position: sticky; bottom: -1px; z-index: 2;
    margin-top: 0; padding: 12px 0 2px;
    background: var(--nav-surface);
    border-top: 1px solid var(--nav-line-soft);
}
.nav-modal-ico-plus { font-size: 27px; font-weight: 400; color: var(--nav-accent); }
.nav-form { display: grid; gap: 15px; padding-bottom: 4px; }
.nav-form-row { display: flex; gap: 10px; align-items: stretch; }
.nav-form-row .nav-input { flex: 1; min-width: 0; }
.nav-form-row .nav-btn { height: 44px; flex: 0 0 auto; white-space: nowrap; }
.nav-form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nav-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.nav-field > label { font-size: 12.5px; font-weight: 600; color: var(--nav-ink-soft); letter-spacing: .2px; }
.nav-req { font-style: normal; color: var(--nav-danger); }
.nav-field-hint { margin: 0; font-size: 12px; line-height: 1.55; color: var(--nav-ink-faint); }
.nav-input {
    width: 100%; height: 44px; padding: 0 13px;
    font-family: inherit; font-size: 14px; color: var(--nav-ink);
    background: var(--nav-input-bg); border: 1px solid var(--nav-line); border-radius: 12px;
    transition: border-color .16s, box-shadow .16s, background .16s;
}
.nav-input::placeholder { color: var(--nav-ink-faint); }
.nav-input:hover { border-color: var(--nav-hover-line); }
.nav-input:focus {
    outline: none; border-color: var(--nav-accent); background: var(--nav-surface);
    box-shadow: 0 0 0 4px var(--nav-accent-ring);
}
textarea.nav-input { height: auto; min-height: 82px; padding: 11px 13px; line-height: 1.6; resize: vertical; }
select.nav-input { padding-right: 30px; cursor: pointer; }
.nav-form-msg { min-height: 20px; margin: 0; font-size: 13px; line-height: 1.6; color: var(--nav-danger); }
.nav-form-msg.is-ok { color: var(--nav-ok); }
.nav-check {
    display: flex; align-items: center; gap: 9px;
    padding: 2px 0; font-size: 13px; color: var(--nav-ink-soft);
    cursor: pointer; user-select: none;
}
.nav-check input {
    width: 17px; height: 17px; flex: 0 0 17px; margin: 0;
    accent-color: var(--nav-primary); cursor: pointer;
}
.nav-check:hover { color: var(--nav-ink); }
.nav-modal-ico-link { color: var(--nav-accent); }
.nav-modal-ico-link svg { width: 26px; height: 26px; }
.nav-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 2px; }
.nav-btn-ghost { background: transparent; }
.nav-preview {
    display: flex; gap: 13px; align-items: flex-start;
    padding: 13px 14px; border: 1px dashed var(--nav-line); border-radius: 14px;
    background: var(--nav-surface-2);
}
.nav-preview.is-empty { border-style: dashed; }
.nav-preview-ico {
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px;
    background: var(--nav-surface); border: 1px solid var(--nav-line);
    display: grid; place-items: center; overflow: hidden;
}
.nav-preview-ico img { width: 28px; height: 28px; object-fit: contain; }
.nav-preview-ico .nav-ico-fallback { font-size: 19px; font-weight: 700; color: var(--nav-accent); }
.nav-preview-body { min-width: 0; flex: 1; }
.nav-preview-title { font-size: 14.5px; font-weight: 600; color: var(--nav-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-preview-desc { font-size: 12.5px; color: var(--nav-ink-soft); line-height: 1.55; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nav-preview-host { font-size: 11.5px; color: var(--nav-ink-faint); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-preview.is-empty .nav-preview-title { color: var(--nav-ink-faint); font-weight: 500; }

/* ── 编辑网站模态框（超管 · 页面内） ──────── */
.nav-form-actions-split { justify-content: flex-start; flex-wrap: wrap; }
.nav-form-actions-split .nav-btn-danger { margin-right: auto; }
.nav-btn-danger { color: var(--nav-danger); border-color: var(--nav-danger); background: transparent; }
.nav-btn-danger:hover { color: var(--nav-danger); border-color: var(--nav-danger); background: rgba(229, 72, 77, .1); }
html[data-theme="dark"] .nav-btn-danger:hover { background: rgba(255, 128, 128, .14); }
.nav-color-row { display: flex; gap: 9px; align-items: stretch; }
.nav-color-row .nav-input { flex: 1; min-width: 0; }
.nav-color {
    width: 46px; height: 44px; flex: 0 0 46px; padding: 4px;
    border: 1px solid var(--nav-line); border-radius: 12px;
    background: var(--nav-input-bg); cursor: pointer;
}
.nav-color::-webkit-color-swatch-wrapper { padding: 0; }
.nav-color::-webkit-color-swatch { border: none; border-radius: 7px; }
.nav-color::-moz-color-swatch { border: none; border-radius: 7px; }
#editDetail { min-height: 108px; }

/* ── 轻提示 ─────────────────────────────── */
.nav-toast {
    position: fixed; left: 50%; bottom: 34px; z-index: 200;
    transform: translateX(-50%) translateY(10px);
    padding: 10px 22px; border-radius: 999px;
    background: var(--nav-ink); color: var(--nav-bg);
    font-size: 13.5px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.nav-toast.is-show { opacity: .96; transform: translateX(-50%) translateY(0); }

/* ── 编辑态（admin / superadmin） ───────── */
.nav-edit-bar {
    display: none; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 9px clamp(16px, 3vw, 28px); background: var(--nav-edit-bg);
    border-bottom: 1px solid var(--nav-edit-line);
    color: var(--nav-edit-ink); font-size: 13.5px;
}
.nav-edit-bar .nav-btn { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 10px; }
body.nav-editing .nav-edit-bar { display: flex; }
.nav-edit-bar-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.nav-edit-bar-hint {
    min-width: 0; font-size: 12.5px; opacity: .8;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-edit-bar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-btn-edit-exit {
    background: var(--nav-edit-ink); border-color: transparent; color: var(--nav-edit-bg);
    font-weight: 700;
}
.nav-btn-edit-exit:hover {
    background: var(--nav-edit-ink); border-color: transparent;
    color: var(--nav-edit-bg); filter: brightness(1.06);
}

/* 卡片编辑工具条（编辑态才占位，平时不渲染/不显示） */
.nav-card-tools { display: none; }
body.nav-editing .nav-card-tools {
    display: flex; flex: 1 1 100%; width: 100%; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-top: 12px; padding-top: 10px;
    border-top: 1px dashed var(--nav-line);
}
.nav-card-grip {
    cursor: grab; color: var(--nav-ink-faint); font-size: 16px; line-height: 1;
    letter-spacing: 1px; padding: 0 3px; user-select: none;
}
.nav-card-grip:active { cursor: grabbing; }
.nav-tool {
    height: 26px; min-width: 26px; padding: 0 7px; border-radius: 8px;
    border: 1px solid var(--nav-line); background: var(--nav-elev);
    color: var(--nav-ink-soft); font-size: 12px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.nav-tool:hover { border-color: var(--nav-accent); color: var(--nav-accent); }
.nav-tool:active { transform: translateY(1px); }
.nav-tool-edit {
    margin-left: auto; gap: 4px; padding: 0 10px;
    color: var(--nav-accent); border-color: var(--nav-accent-soft); background: var(--nav-accent-soft);
    font-weight: 600;
}
.nav-tool-edit:hover { border-color: var(--nav-accent); }

/* 分类顺序调整（编辑态，标题右侧） */
.nav-section-move { display: none; margin-left: 8px; gap: 4px; }
body.nav-editing .nav-section-move { display: inline-flex; }
.nav-section-move button {
    width: 26px; height: 26px; border-radius: 8px;
    border: 1px dashed var(--nav-edit-line); background: var(--nav-edit-bg);
    color: var(--nav-edit-ink); font-size: 12px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.nav-section-move button:hover { border-style: solid; filter: brightness(.97); }
.nav-section-move button:disabled { opacity: .35; cursor: not-allowed; }

/* 拖拽排序反馈 */
body.nav-editing .nav-card img { -webkit-user-drag: none; }
body.nav-editing .nav-card { user-select: none; }
body.nav-dragging, body.nav-dragging * { cursor: grabbing !important; }
.nav-card.is-dragging {
    opacity: .42; border-style: dashed; box-shadow: none;
    transform: scale(.985);
}
.nav-card.drop-before, .nav-card.drop-after { border-color: var(--nav-accent); }
.nav-card.drop-before::before, .nav-card.drop-after::before {
    content: ""; position: absolute; top: 10px; bottom: 10px; width: 3px; z-index: 5;
    border-radius: 3px; background: var(--nav-accent);
    box-shadow: 0 0 0 2px var(--nav-accent-ring);
}
.nav-card.drop-before::before { left: 0; }
.nav-card.drop-after::before { right: 0; }

/* 增量渲染：加载更多 */
.nav-more {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 18px 0 2px; color: var(--nav-ink-faint); font-size: 12.5px;
}
.nav-more-btn { height: 34px; padding: 0 16px; border-radius: 10px; font-size: 13px; }

/* ── 页尾（全页宽 / 内容居中 / 友链卡片） ─── */
.nav-footer {
    width: 100%; max-width: none; margin: 0; padding: 0;
    border-top: 1px solid var(--nav-line);
    background: var(--nav-footer-bg);
    position: relative;
}
.nav-footer::before {
    content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(47, 107, 255, .22) 30%, rgba(106, 75, 255, .2) 70%, transparent);
    pointer-events: none;
}
.nav-footer-inner {
    width: 100%; max-width: none;
    margin: 0 auto; padding: 24px clamp(24px, 4vw, 64px) 18px;
    display: flex; flex-direction: column; gap: 15px;
}
.nav-friend { display: flex; flex-direction: column; gap: 11px; }
.nav-friend-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav-btn-friend {
    margin-left: 2px; height: 34px; padding: 0 14px;
    border-radius: 10px; font-size: 12.5px; font-weight: 600;
    color: var(--nav-accent); border-color: var(--nav-line);
    background: var(--nav-surface);
}
.nav-btn-friend svg { width: 14px; height: 14px; }
.nav-btn-friend:hover {
    color: var(--nav-accent); border-color: var(--nav-accent);
    background: var(--nav-accent-soft); box-shadow: 0 4px 12px var(--nav-accent-ring);
}
.nav-footer-title {
    display: flex; align-items: center; gap: 8px;
    margin: 0; font-size: 12.5px; font-weight: 700;
    letter-spacing: 1.4px; color: var(--nav-ink-soft); white-space: nowrap;
}
.nav-footer-title svg { width: 15px; height: 15px; color: var(--nav-accent); }
.nav-friend-note { margin: 0; font-size: 12px; color: var(--nav-ink-faint); }
.nav-friend-list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px;
}
.nav-friend-item { display: flex; min-width: 0; }
.nav-friend-link {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 11px 14px; border-radius: 14px;
    background: var(--nav-surface); border: 1px solid var(--nav-line);
    box-shadow: 0 1px 2px rgba(18, 30, 58, .03);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.nav-friend-link:hover {
    transform: translateY(-2px); border-color: var(--nav-hover-line);
    box-shadow: var(--nav-shadow);
}
.nav-friend-ico {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--nav-accent-soft); color: var(--nav-accent);
}
.nav-friend-ico svg { width: 19px; height: 19px; }
.nav-friend-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.nav-friend-name {
    font-size: 13.5px; font-weight: 600; color: var(--nav-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: color .15s;
}
.nav-friend-desc {
    font-size: 11.5px; color: var(--nav-ink-faint); line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: color .15s;
}
.nav-friend-arrow { width: 16px; height: 16px; color: var(--nav-ink-faint); opacity: .75; transition: color .15s, transform .18s, opacity .15s; }
.nav-friend-link:hover .nav-friend-name { color: var(--nav-accent); }
.nav-friend-link:hover .nav-friend-desc { color: var(--nav-ink-soft); }
.nav-friend-link:hover .nav-friend-arrow { color: var(--nav-accent); opacity: 1; transform: translate(1px, -1px); }
.nav-footer-meta {
    padding-top: 13px; border-top: 1px solid var(--nav-line-soft);
    display: flex; align-items: center; justify-content: center; text-align: center;
}
.nav-copy {
    margin: 0; font-size: 12px; line-height: 1.7; color: var(--nav-ink-muted);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 2px 9px; max-width: 100%;
}
.nav-copy-item { white-space: normal; }
.nav-copy-sep { color: var(--nav-ink-faint); opacity: .5; }
.nav-copy-icp-link { color: var(--nav-ink-muted); transition: color .15s; }
.nav-copy-icp-link:hover { color: var(--nav-accent); }
.nav-friend-link { height: 100%; }

/* 置顶按钮：滚动超阈值显示，固定右下角 */
.nav-back-top {
    position: fixed; right: 26px; bottom: 26px; z-index: 60;
    width: 44px; height: 44px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--nav-accent); color: #fff; border: none; cursor: pointer;
    box-shadow: 0 6px 20px rgba(47, 107, 255, .35);
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, filter .15s;
}
.nav-back-top svg { width: 20px; height: 20px; }
.nav-back-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.nav-back-top:hover { filter: brightness(1.08); }

/* 页脚保持上下结构：友链区在上，版权/备案行在下并水平居中（全宽背景不变） */

/* ── 桌面仪表盘布局：整页自然滚动 + 侧边栏固定面板（独立滚动条） + 全宽页尾 ──
   侧栏高度由 nav.js 的 syncSidebarHeight() 动态计算：
   页尾进入视口后侧栏下沿停在页尾上沿（不遮盖全宽页尾），否则撑满视口高度。 */
@media (min-width: 901px) {
    html, body { height: auto; }
    body.nav-page {
        display: block; height: auto; min-height: 100vh;
        overflow: visible;
    }
    .nav-page .nav-topbar { position: sticky; top: 0; z-index: 50; }
    .nav-page .nav-shell { display: block; width: 100%; }
    .nav-page .nav-sidebar {
        position: fixed; left: 0; top: var(--nav-topbar-h); right: auto; bottom: auto;
        width: var(--nav-sidebar-w); height: calc(100vh - var(--nav-topbar-h));
        overflow-y: auto; z-index: 40;
        padding-bottom: 24px;
        scrollbar-width: thin; scrollbar-color: var(--nav-line) transparent;
    }
    .nav-page .nav-content {
        margin-left: var(--nav-sidebar-w);
        overflow: visible; min-height: 0;
    }
    /* 编辑态工具条在文档流里，层级放到固定侧栏之上，避免左侧文字被侧栏压住 */
    .nav-page .nav-edit-bar { position: relative; z-index: 45; }
    .nav-page .nav-sidebar::-webkit-scrollbar { width: 8px; }
    .nav-page .nav-sidebar::-webkit-scrollbar-thumb { background: var(--nav-line); border-radius: 99px; }
    .nav-page .nav-sidebar::-webkit-scrollbar-track { background: transparent; }
}

/* ── 响应式 ─────────────────────────────── */
.nav-menu-toggle { display: none; }
@media (max-width: 1180px) {
    .nav-brand-text { display: none; }
    .nav-grid, .nav-skel-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (max-width: 900px) {
    /* 小屏恢复自然流式：页面整体滚动，页脚跟在内容后面 */
    body.nav-page { display: block; height: auto; min-height: 100vh; overflow: visible; }
    .nav-page .nav-shell { display: block; }
    .nav-page .nav-content { overflow: visible; }
    .nav-sidebar {
        position: fixed; left: 0; top: var(--nav-topbar-h); z-index: 40;
        height: calc(100vh - var(--nav-topbar-h)); overflow-y: auto;
        transform: translateX(-100%); transition: transform .24s ease;
        box-shadow: var(--nav-shadow-hover);
        border-top-right-radius: 18px; border-bottom-right-radius: 18px;
    }
    body.nav-side-open .nav-sidebar { transform: none; }
    .nav-menu-toggle { display: inline-flex; }
    .nav-content { --nav-cpad-x: 18px; padding: 24px var(--nav-cpad-x) 48px; background-size: 100% 320px; }
    .nav-search { max-width: none; }
    .nav-search-kbd { display: none; }
    .nav-search input { padding-right: 16px; }
    .nav-grid, .nav-skel-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
    .nav-content-head h1 { font-size: 24px; }
    .nav-footer-inner { padding: 20px 20px 16px; }
    .nav-footer-meta { text-align: center; }
    .nav-friend-item { flex: 1 1 100%; }
    /* 小屏编辑条：只留提示标签与操作按钮 */
    .nav-edit-bar-hint { display: none; }
    .nav-edit-bar { gap: 8px; padding: 8px 14px; }
    .nav-edit-bar-actions { margin-left: auto; gap: 6px; }
}
@media (max-width: 640px) {
    .nav-form-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .nav-topbar { padding: 0 12px; gap: 10px; }
    /* 小屏优先保证搜索框宽度：导航页只留 logo 方块，认证页保留品牌文字 */
    .nav-topbar:not(.auth-topbar) .nav-brand > span:last-child { display: none; }
    .nav-top-actions .nav-btn { padding: 0 12px; }
    .nav-top-actions #logoutBtn .nav-btn-label { display: none; }
    /* 申请按钮小屏收成「＋申请」，避免顶栏挤压搜索框 */
    .nav-btn-apply .nav-btn-label { display: none; }
    .nav-btn-apply .nav-btn-label-sm { display: inline; }
    .nav-btn-apply { padding: 0 11px; gap: 4px; }
    .nav-search input { height: 42px; }
    .nav-grid, .nav-skel-grid { grid-template-columns: 1fr; }
    .nav-avatar-btn .nav-avatar { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; font-size: 14px; }
    .nav-btn-friend { height: 32px; padding: 0 12px; font-size: 12px; }
    .nav-content { --nav-cpad-x: 14px; padding: 20px var(--nav-cpad-x) 40px; }
    .nav-content-head h1 { font-size: 22px; }
    .nav-section { margin-bottom: 28px; }
    .nav-section-title { font-size: 16px; }
    .nav-footer-inner { gap: 14px; padding: 18px 14px 14px; }
    .nav-friend { gap: 9px; }
    .nav-friend-head { gap: 8px; }
    .nav-friend-link { padding: 10px 12px; }
    .nav-friend-name { font-size: 13px; }
    .nav-form-row { flex-direction: column; }
    .nav-form-row .nav-btn { width: 100%; justify-content: center; }
    .nav-modal-head { padding: 22px 20px 14px; }
    .nav-modal-body { padding: 0 20px 6px; }
    .nav-form-actions .nav-btn { flex: 1; justify-content: center; }
    .nav-copy { font-size: 11.5px; gap: 1px 7px; }
    /* 小屏顶栏：编辑入口收成图标，避免挤压搜索框 */
    .nav-edit-entry { width: 40px; padding: 0; justify-content: center; }
    .nav-edit-entry .nav-btn-label { display: none; }
    .nav-edit-entry-ico { width: 17px; height: 17px; }
    .nav-card-tools { gap: 5px; margin-top: 10px; padding-top: 9px; }
    .nav-tool { height: 25px; min-width: 25px; padding: 0 6px; font-size: 11.5px; }
    .nav-tool-edit { padding: 0 8px; }
    .nav-edit-bar .nav-btn { padding: 0 10px; font-size: 12.5px; }
}
@media (max-width: 420px) {
    /* 极窄屏：隐藏品牌块、收紧菜单键，把宽度让给搜索框 */
    .nav-topbar:not(.auth-topbar) .nav-brand { display: none; }
    .nav-menu-toggle { width: 40px; padding: 0; justify-content: center; }
    .nav-topbar { gap: 8px; padding: 0 10px; }
    .nav-top-actions { gap: 6px; }
    /* 极窄屏再收 4px，给搜索框留宽 */
    .nav-edit-entry { width: 36px; }
    .nav-edit-entry-ico { width: 16px; height: 16px; }
    /* 申请按钮收成纯「＋」图标，给搜索框留出更多宽度 */
    .nav-btn-apply .nav-btn-label-sm { display: none; }
    .nav-btn-apply { width: 40px; padding: 0; justify-content: center; }
    #loginBtn { padding: 0 13px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
