/* ============================================================
   nav-theme.css — 首页 / 登录页视觉主题
   源文件: static-nav/res/  →  pages/scripts/build.mjs 复制到 public/res/
   纯 CSS 增强，不改 DOM 结构与业务逻辑；在 Tailwind CDN 之后加载。
   ============================================================ */

:root {
    --nv-primary: var(--nv-primary);
    --nv-primary-rgb: 14, 155, 116;
    --nv-primary-soft: var(--nv-primary-soft);
    --nv-gradient-from: var(--nv-primary);
    --nv-gradient-to: #3ec79c;
    --nv-grad-2-rgb: 62, 199, 156;
    --nv-gradient: linear-gradient(135deg, var(--nv-gradient-from) 0%, var(--nv-gradient-to) 100%);
    --nv-ink: #101828;
    --nv-sub: #667085;
    --nv-bg: #f6f8fd;
    --nv-card: #ffffff;
    --nv-glass: rgba(255, 255, 255, .74);
    --nv-line: rgba(16, 24, 40, .08);
    --nv-shadow: 0 8px 28px -14px rgba(31, 41, 84, .28);
    --nv-shadow-hover: 0 18px 38px -16px rgba(var(--nv-primary-rgb), .42);
}

body.dark {
    --nv-primary: var(--nv-primary);
    --nv-primary-rgb: 74, 222, 159;
    --nv-primary-soft: rgba(74, 222, 159, .12);
    --nv-gradient-from: var(--nv-primary);
    --nv-gradient-to: #34d399;
    --nv-grad-2-rgb: 52, 211, 153;
    --nv-gradient: linear-gradient(135deg, var(--nv-gradient-from) 0%, var(--nv-gradient-to) 100%);
    --nv-ink: #f2f4ff;
    --nv-sub: #a5adc4;
    --nv-bg: #0b1020;
    --nv-card: #151b30;
    --nv-glass: rgba(20, 26, 46, .74);
    --nv-line: rgba(255, 255, 255, .09);
    --nv-shadow: 0 10px 30px -14px rgba(0, 0, 0, .75);
    --nv-shadow-hover: 0 18px 40px -16px rgba(74, 222, 159, .55);
}

body.page-home,
body.page-login {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--nv-ink);
    background-color: var(--nv-bg);
    -webkit-font-smoothing: antialiased;
}

body.page-home {
    background-image:
        radial-gradient(900px 480px at 8% -10%, rgba(var(--nv-primary-rgb), .18), transparent 62%),
        radial-gradient(760px 420px at 96% 2%, rgba(var(--nv-grad-2-rgb), .13), transparent 60%);
    background-attachment: fixed;
}

body.dark.page-home {
    background-image:
        radial-gradient(900px 480px at 8% -10%, rgba(var(--nv-primary-rgb), .20), transparent 62%),
        radial-gradient(760px 420px at 96% 2%, rgba(var(--nv-grad-2-rgb), .10), transparent 60%);
}

/* ---------------- 首页：顶部 ---------------- */
body.page-home > header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--nv-glass) !important;
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid var(--nv-line);
    box-shadow: 0 6px 24px -18px rgba(16, 24, 40, .6) !important;
    padding-top: 14px !important;
    padding-bottom: 16px !important;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    background: var(--nv-gradient);
    color: #fff;
    font-size: 19px;
    box-shadow: 0 10px 24px -10px rgba(var(--nv-primary-rgb), .75);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.brand-text strong {
    font-size: 18px;
    font-weight: 750;
    letter-spacing: .2px;
    color: var(--nv-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.brand-text small {
    font-size: 12px;
    color: var(--nv-sub);
    margin-top: 3px;
    letter-spacing: .4px;
}

body.page-home #current-time-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding: 9px 16px;
    border-radius: 14px;
    background: var(--nv-card);
    border: 1px solid var(--nv-line);
    box-shadow: var(--nv-shadow);
    color: var(--nv-sub) !important;
    font-size: 12px;
    margin-bottom: 0 !important;
    text-align: right !important;
}

body.page-home #current-time {
    font-size: 15px;
    font-weight: 700;
    color: var(--nv-ink);
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

/* ---------------- 首页：搜索 ---------------- */
body.page-home .search-shell {
    max-width: 640px !important;
    margin-top: 6px;
}

body.page-home .search-bar {
    background: var(--nv-card) !important;
    border: 1px solid var(--nv-line);
    border-radius: 18px;
    padding: 5px;
    box-shadow: var(--nv-shadow);
    transition: box-shadow .25s ease, transform .25s ease;
}

body.page-home .search-bar:focus-within {
    box-shadow: 0 0 0 4px rgba(var(--nv-primary-rgb), .14), var(--nv-shadow-hover);
    transform: translateY(-1px);
}

body.page-home .search-bar input,
body.page-home .search-bar select,
body.page-home .search-bar > button {
    height: 44px !important;
}

body.page-home #search-input {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--nv-ink);
    padding-left: 14px !important;
    font-size: 14px;
    border-radius: 14px 0 0 14px !important;
}

body.page-home #search-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

body.page-home #search-engine {
    border: 0 !important;
    border-left: 1px solid var(--nv-line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--nv-sub) !important;
    font-size: 13px;
    padding-left: 14px !important;
    padding-right: 10px !important;
    box-shadow: none !important;
    outline: none !important;
}

body.page-home #search-button {
    border: 0 !important;
    border-radius: 14px !important;
    background: var(--nv-gradient) !important;
    color: #fff;
    padding: 0 20px !important;
    box-shadow: 0 8px 18px -10px rgba(var(--nv-primary-rgb), .9);
    transition: transform .2s ease, filter .2s ease;
}

body.page-home #search-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

body.page-home .search-hint {
    text-align: center;
    font-size: 12px;
    color: var(--nv-sub);
    margin-top: 10px;
    letter-spacing: .4px;
}

/* ---------------- 首页：侧边栏 ---------------- */
body.page-home #sidebar-nav {
    background: var(--nv-card) !important;
    border: 1px solid var(--nv-line);
    border-radius: 22px !important;
    box-shadow: var(--nv-shadow) !important;
    padding: 20px !important;
}

body.page-home #sidebar-nav h3 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .3px;
    margin-bottom: 16px !important;
    color: var(--nv-ink) !important;
}

body.page-home #sidebar-nav h3 i {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    background: var(--nv-primary-soft);
    color: var(--nv-primary) !important;
    font-size: 13px;
    margin-right: 10px !important;
}

body.page-home #sidebar-nav ul > li > a {
    background: transparent !important;
    box-shadow: none !important;
    border: 1px solid transparent;
    border-radius: 13px !important;
    padding: 9px 12px !important;
    color: var(--nv-ink) !important;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

body.page-home #sidebar-nav ul > li > a:hover {
    background: var(--nv-primary-soft) !important;
    border-color: rgba(var(--nv-primary-rgb), .18);
    transform: translateX(3px);
}

body.page-home #sidebar-nav ul > li > a > i:first-child {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
    background: var(--nv-primary-soft);
    color: var(--nv-primary) !important;
    font-size: 12px;
    margin-right: 10px !important;
}

body.page-home #sidebar-nav ul > li > a > span:last-child {
    background: var(--nv-primary-soft) !important;
    color: var(--nv-primary) !important;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

/* ---------------- 首页：分类卡片 ---------------- */
@keyframes nv-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

body.page-home #category-container > div[id^="category-"] {
    background: var(--nv-card) !important;
    border: 1px solid var(--nv-line);
    border-radius: 22px !important;
    box-shadow: var(--nv-shadow) !important;
    margin-bottom: 24px !important;
    animation: nv-fade-up .45s ease both;
    transition: transform .25s ease, box-shadow .25s ease;
}

body.page-home #category-container > div[id^="category-"]:nth-child(2) { animation-delay: .05s; }
body.page-home #category-container > div[id^="category-"]:nth-child(3) { animation-delay: .1s; }
body.page-home #category-container > div[id^="category-"]:nth-child(4) { animation-delay: .15s; }

body.page-home #category-container > div[id^="category-"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--nv-shadow-hover) !important;
}

body.page-home #category-container > div[id^="category-"] > div:first-child {
    background: linear-gradient(90deg, rgba(var(--nv-primary-rgb), .10), rgba(var(--nv-grad-2-rgb), .05)) !important;
    border-bottom: 1px solid var(--nv-line);
    padding: 14px 20px !important;
    position: relative;
}

body.page-home #category-container > div[id^="category-"] > div:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--nv-gradient);
}

body.page-home #category-container h2 {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--nv-ink) !important;
    letter-spacing: .3px;
}

body.page-home #category-container > div[id^="category-"] > div:first-child > i {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-grid;
    place-items: center;
    background: #fff;
    color: var(--nv-primary) !important;
    font-size: 15px !important;
    margin-right: 12px !important;
    box-shadow: 0 4px 12px -6px rgba(var(--nv-primary-rgb), .5);
}

body.dark.page-home #category-container > div[id^="category-"] > div:first-child > i {
    background: rgba(255, 255, 255, .07) !important;
}

/* ---------------- 首页：书签卡片 ---------------- */
body.page-home #category-container ul[id^="link-list-"] > li {
    background: var(--nv-card) !important;
    border: 1px solid var(--nv-line);
    border-radius: 16px !important;
    box-shadow: 0 4px 14px -10px rgba(16, 24, 40, .35) !important;
    padding: 6px !important;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

body.page-home #category-container ul[id^="link-list-"] > li:hover {
    transform: translateY(-4px);
    box-shadow: var(--nv-shadow-hover) !important;
    border-color: rgba(var(--nv-primary-rgb), .35) !important;
}

body.page-home #category-container ul[id^="link-list-"] > li a {
    padding: 8px !important;
    gap: 10px;
    color: var(--nv-ink) !important;
    text-decoration: none;
}

body.page-home #category-container ul[id^="link-list-"] > li a > i:first-child {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--nv-primary-soft);
    color: var(--nv-primary) !important;
    font-size: 16px !important;
    margin-right: 2px !important;
}

body.page-home #category-container ul[id^="link-list-"] > li a > img {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px;
    border-radius: 12px !important;
    margin-right: 2px !important;
    border: 1px solid var(--nv-line);
}

body.page-home #category-container ul[id^="link-list-"] > li a > div > div:first-child {
    font-size: 13.5px !important;
    font-weight: 650 !important;
    color: var(--nv-ink) !important;
}

body.page-home #category-container ul[id^="link-list-"] > li a > div > div:last-child {
    font-size: 11.5px !important;
    color: var(--nv-sub) !important;
    margin-top: 3px !important;
}

body.page-home #category-container ul[id^="link-list-"] > li a::after {
    content: "\2197";
    margin-left: auto;
    color: var(--nv-primary);
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: opacity .22s ease, transform .22s ease;
    font-size: 14px;
    flex: 0 0 auto;
}

body.page-home #category-container ul[id^="link-list-"] > li:hover a::after {
    opacity: 1;
    transform: none;
}

/* ---------------- 首页：悬浮按钮 / 页脚 / 弹层 ---------------- */
body.page-home .fixed.bottom-6.right-6 button {
    width: 46px;
    height: 46px;
    border-radius: 16px !important;
    display: grid;
    place-items: center;
    border: 1px solid var(--nv-line) !important;
    box-shadow: var(--nv-shadow-hover) !important;
    transition: transform .2s ease, filter .2s ease;
    font-size: 15px;
}

body.page-home .fixed.bottom-6.right-6 button:hover {
    transform: translateY(-3px) scale(1.04);
}

body.page-home #submit-bookmark-btn {
    background: var(--nv-gradient) !important;
    color: #fff !important;
}

body.page-home #theme-toggle-btn {
    background: var(--nv-card) !important;
    color: var(--nv-primary) !important;
}

body.page-home #back-to-top-btn {
    background: var(--nv-gradient) !important;
    color: #fff !important;
}

body.page-home > footer {
    background: var(--nv-glass) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--nv-line);
    box-shadow: none !important;
    margin-top: 48px;
    padding-top: 22px !important;
    padding-bottom: 22px !important;
    color: var(--nv-sub) !important;
}

body.page-home #submit-bookmark-modal > div,
body.page-home #announcement-toast {
    background: var(--nv-card) !important;
    border: 1px solid var(--nv-line);
    border-radius: 22px !important;
    box-shadow: 0 30px 70px -24px rgba(16, 24, 40, .5) !important;
}

body.page-home #submit-bookmark-modal input,
body.page-home #submit-bookmark-modal select {
    border-radius: 12px !important;
    border-color: var(--nv-line) !important;
    background: var(--nv-card) !important;
    color: var(--nv-ink) !important;
}

body.page-home #submit-bookmark-modal input:focus,
body.page-home #submit-bookmark-modal select:focus {
    box-shadow: 0 0 0 3px rgba(var(--nv-primary-rgb), .15) !important;
    border-color: rgba(var(--nv-primary-rgb), .5) !important;
}

/* ---------------- 登录页 ---------------- */
body.page-login {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px;
    background-image:
        radial-gradient(760px 420px at 12% 8%, rgba(var(--nv-primary-rgb), .22), transparent 62%),
        radial-gradient(680px 400px at 92% 92%, rgba(var(--nv-grad-2-rgb), .18), transparent 60%),
        linear-gradient(160deg, var(--nv-primary-soft) 0%, #f8fafc 55%, #effaf5 100%);
    background-attachment: fixed;
}

body.page-login > .login-card {
    background: var(--nv-glass) !important;
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--nv-line);
    border-radius: 26px !important;
    box-shadow: 0 30px 70px -28px rgba(var(--nv-primary-rgb), .45) !important;
    padding: 38px 36px !important;
    max-width: 430px !important;
    position: relative;
    overflow: hidden;
    animation: nv-fade-up .5s ease both;
}

body.page-login > .login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--nv-gradient);
}

body.page-login .login-hero-icon {
    width: 66px;
    height: 66px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px !important;
    background: var(--nv-gradient);
    color: #fff !important;
    font-size: 26px !important;
    box-shadow: 0 14px 30px -12px rgba(var(--nv-primary-rgb), .8);
}

body.page-login h1 {
    font-size: 22px !important;
    font-weight: 750 !important;
    color: var(--nv-ink) !important;
    letter-spacing: .3px;
}

body.page-login p.text-gray-600 {
    color: var(--nv-sub) !important;
    font-size: 13px;
}

body.page-login label {
    color: var(--nv-ink) !important;
    font-size: 13px;
    font-weight: 600;
}

body.page-login input {
    border-radius: 13px !important;
    border: 1px solid var(--nv-line) !important;
    background: var(--nv-card) !important;
    color: var(--nv-ink);
    transition: box-shadow .2s ease, border-color .2s ease;
}

body.page-login input:focus {
    box-shadow: 0 0 0 4px rgba(var(--nv-primary-rgb), .14) !important;
    border-color: rgba(var(--nv-primary-rgb), .5) !important;
    outline: none;
}

body.page-login button[type="submit"] {
    background: var(--nv-gradient) !important;
    border-radius: 13px !important;
    height: 48px;
    font-weight: 650;
    letter-spacing: .5px;
    box-shadow: 0 12px 26px -12px rgba(var(--nv-primary-rgb), .9);
    transition: transform .2s ease, filter .2s ease;
}

body.page-login button[type="submit"]:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

body.page-login #login-error {
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .2);
    border-radius: 12px;
    padding: 10px;
    color: #dc2626 !important;
}

/* ---------------- 响应式与无障碍 ---------------- */
@media (max-width: 768px) {
    body.page-home > header { padding-left: 12px !important; padding-right: 12px !important; }
    .brand-text small { display: none; }
    .brand-text strong { max-width: 150px; font-size: 16px; }
    body.page-home #current-time-container { align-items: center; padding: 7px 12px; text-align: center !important; }
    body.page-home .search-shell { margin-top: 14px; }
    body.page-home .search-bar { border-radius: 16px; }
    body.page-home #search-engine { max-width: 96px; padding-left: 8px !important; padding-right: 4px !important; font-size: 12px; }
    body.page-home #search-button { padding: 0 14px !important; }
    body.page-home .search-hint { display: none; }
    body.page-home #sidebar-nav { border-radius: 18px !important; padding: 16px !important; }
    body.page-home #category-container > div[id^="category-"] { border-radius: 18px !important; }
    body.page-home #category-container > div[id^="category-"] > div:first-child { padding: 12px 14px !important; }
    body.page-login > .login-card { padding: 32px 24px !important; }
}

@media (prefers-reduced-motion: reduce) {
    body.page-home *, body.page-login * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ============================================================
   首屏 Hero（参考「拾光书签」风格重做）
   纯 CSS 覆盖上方旧版 header / brand / 搜索规则，DOM id 全部保留；
   背景为零外部依赖的渐变 + 光斑，暗色模式自动压暗。
   ============================================================ */
body.page-home .hero {
    --hero-ink: #2c3446;
    --hero-sub: #3e4658;
    --hero-blue: var(--nv-primary);
    --hero-glass: rgba(255, 255, 255, .66);
    --hero-line: rgba(255, 255, 255, .82);
    --hero-a: #cdd6e3;
    --hero-b: #c3cddd;
    --hero-c: #d5dce7;
    --hero-glow-a: rgba(255, 255, 255, .24);
    --hero-glow-b: rgba(255, 255, 255, .16);
}
body.dark.page-home .hero {
    --hero-ink: #eef2fb;
    --hero-sub: #c4ccdd;
    --hero-blue: var(--nv-primary);
    --hero-glass: rgba(20, 27, 52, .58);
    --hero-line: rgba(255, 255, 255, .16);
    --hero-a: #26304a;
    --hero-b: #1e2740;
    --hero-c: #2b3550;
    --hero-glow-a: rgba(120, 150, 220, .16);
    --hero-glow-b: rgba(90, 120, 190, .12);
}

body.page-home > header.hero {
    position: relative !important;
    top: auto !important;
    z-index: 1;
    padding: 0 !important;
    margin: 0;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(16, 24, 40, .07) !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    overflow: hidden;
    isolation: isolate;
}
body.dark.page-home > header.hero { border-bottom-color: rgba(255, 255, 255, .08) !important; }

body.page-home .hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-color: #c6d0de;
    background-image:
        radial-gradient(620px 380px at var(--gx, 16%) var(--gy, 10%), var(--hero-glow-a), transparent 68%),
        radial-gradient(560px 360px at var(--hx, 88%) var(--hy, 84%), var(--hero-glow-b), transparent 66%),
        linear-gradient(118deg, var(--hero-a) 0%, var(--hero-b) 54%, var(--hero-c) 100%);
    transition: filter .5s ease;
}
@keyframes nv-hero-flash { from { opacity: .58; } to { opacity: 1; } }
body.page-home .hero.hero-flash .hero-bg { animation: nv-hero-flash .42s ease both; }

body.page-home .hero-inner { position: relative; padding: 18px 24px 20px; }
body.page-home .hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
body.page-home .hero-brand { min-width: 0; max-width: 680px; }

/* 蓝色实心书签图标 + 蓝色标题（与参考截图一致） */
body.page-home .hero .brand { gap: 9px; }
body.page-home .hero .brand-mark {
    width: 24px; height: 28px; flex: 0 0 24px;
    border-radius: 0 !important; font-size: 23px; line-height: 28px;
    display: grid; place-items: center;
    background: transparent !important;
    color: var(--hero-blue) !important;
    box-shadow: none !important;
}
body.page-home .hero .brand-text strong {
    color: var(--hero-blue) !important;
    font-size: 19px; font-weight: 800; max-width: none; letter-spacing: .5px;
}
body.page-home .hero-slogan {
    margin: 8px 0 0; max-width: 610px;
    font-size: 14px; line-height: 1.85;
    color: var(--hero-sub); letter-spacing: .2px;
}
body.page-home .hero #current-time-container {
    display: block !important;
    padding: 0 !important; margin: 8px 0 0 !important;
    background: transparent !important; border: 0 !important; box-shadow: none !important;
    color: var(--hero-sub) !important; text-align: left !important; font-size: 13.5px;
}
body.page-home .hero #current-time {
    font-size: 13.5px; font-weight: 500;
    color: var(--hero-sub) !important; margin: 0 !important;
    font-variant-numeric: tabular-nums;
}
/* 参考样式只显示一行公历日期时间，农历 / 节日倒计时不再占位 */
body.page-home .hero .hero-time-extra { display: none !important; }

body.page-home .hero-actions {
    position: relative;
    display: flex; align-items: flex-start; justify-content: flex-end;
    flex: 0 0 auto; padding-top: 4px;
}
body.page-home .hero-tip {
    position: absolute; top: 46px; right: 0;
    max-width: 270px; padding: 8px 14px;
    border-radius: 10px;
    background: rgba(30, 39, 58, .90); color: #fff;
    font-size: 12px; line-height: 1.5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transform: translateY(-6px);
    pointer-events: none; z-index: 5;
    transition: opacity .22s ease, transform .22s ease;
}
body.page-home .hero-tip.is-visible { opacity: 1; transform: translateY(0); }
body.page-home .hero-tools { display: flex; gap: 9px; }
body.page-home .hero-pill {
    background: var(--hero-glass) !important;
    border: 1px solid var(--hero-line) !important;
    color: var(--hero-ink) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 24px -18px rgba(16, 24, 40, .75);
    font-weight: 600;
    border-radius: 999px !important;
    padding: 8px 17px; font-size: 12.5px;
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    transition: transform .2s ease, box-shadow .2s ease;
}
body.page-home .hero-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px -16px rgba(16, 24, 40, .8);
}

body.page-home .hero .search-shell { max-width: 560px !important; margin-top: 14px; margin-bottom: 0; }
body.page-home .hero .search-bar {
    background: var(--hero-glass) !important;
    border: 1px solid var(--hero-line) !important;
    border-radius: 999px !important;
    padding: 5px 6px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px -22px rgba(16, 24, 40, .7) !important;
}
body.page-home .hero .search-bar:focus-within {
    box-shadow: 0 0 0 4px rgba(var(--nv-primary-rgb), .16), 0 18px 40px -22px rgba(16, 24, 40, .7) !important;
}
body.page-home .hero #search-input { color: var(--hero-ink) !important; border-radius: 999px 0 0 999px !important; }
body.page-home .hero #search-input::placeholder { color: var(--hero-sub); opacity: .92; }
body.page-home .hero #search-engine { color: var(--hero-sub) !important; border-left-color: var(--hero-line) !important; }
body.page-home .hero #search-engine option { color: #101828; background: #fff; }
body.page-home .hero #clear-search-btn { color: var(--hero-sub) !important; }
body.page-home .hero #search-button {
    border-radius: 999px !important;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 0 18px !important;
}
body.page-home .hero .search-button-text { font-size: 13px; font-weight: 600; }
body.page-home .hero .search-hint { display: none; }

/* flex 子项默认 min-width:auto，卡片内的 truncate 文字会撑破两列网格 */
body.page-home #category-container .flex.flex-col.flex-1,
body.page-home #category-container a.min-w-0 { min-width: 0; }

@media (max-width: 640px) {
    /* ---- Hero：压缩高度，按钮与标题同行 ---- */
    body.page-home .hero-inner { padding: 14px 14px 16px; }
    body.page-home .hero-top { display: block; position: relative; }
    body.page-home .hero-brand { max-width: none; }
    body.page-home .hero .brand { padding-right: 148px; }
    body.page-home .hero .brand-text strong { font-size: 17px; }
    body.page-home .hero .brand-mark { width: 22px; height: 26px; flex-basis: 22px; font-size: 21px; line-height: 26px; }
    body.page-home .hero-actions {
        position: absolute; top: -3px; right: 0; width: auto; padding-top: 0;
    }
    body.page-home .hero-pill { padding: 6px 11px; font-size: 11.5px; gap: 5px; }
    body.page-home .hero-tip { top: 40px; max-width: 220px; font-size: 11px; }
    body.page-home .hero-slogan { font-size: 12.5px; line-height: 1.65; margin-top: 8px; max-width: none; }
    body.page-home .hero #current-time-container { margin-top: 8px !important; font-size: 12px; }
    body.page-home .hero #current-time { font-size: 12px; }
    body.page-home .hero .search-shell { margin-top: 12px; }
    body.page-home .hero .search-bar { padding: 4px 5px; }
    body.page-home .hero #search-input {
        padding: 6px 8px 6px 12px !important; font-size: 13px;
    }
    body.page-home .hero #search-engine {
        max-width: 88px; padding-left: 6px !important; padding-right: 2px !important; font-size: 11.5px;
    }
    body.page-home .hero #search-button { padding: 0 12px !important; }
    body.page-home .hero .search-button-text { display: none; }

    /* ---- 移动端分类按钮与主体间距 ---- */
    body.page-home > div.md\:hidden { padding-top: 4px !important; padding-bottom: 4px !important; }
    #mobile-menu-btn { padding-top: 9px !important; padding-bottom: 9px !important; font-size: 13px; }
    body.page-home div.container.mx-auto.max-w-full > div.flex.flex-col {
        padding-top: 10px !important; gap: 12px !important;
    }
    body.page-home #sidebar-nav { padding: 14px !important; }

    /* ---- 书签卡片：名称两行完整显示，手机隐藏描述，避免截断/撑破 ---- */
    body.page-home #category-container ul.grid { gap: 8px !important; }
    body.page-home #category-container ul.grid > li { padding: 8px !important; }
    body.page-home #category-container ul.grid > li > a { padding: 5px !important; gap: 7px; }
    body.page-home #category-container .font-medium.truncate {
        white-space: normal !important; overflow: visible !important; text-overflow: clip !important;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
        word-break: break-word; font-size: 12.5px; line-height: 1.35;
    }
    body.page-home #category-container .text-xs.truncate { display: none !important; }

    /* ---- 悬浮按钮：横向一排，减少对内容的遮挡 ---- */
    body.page-home > div.fixed.bottom-6.right-6 {
        right: 12px !important; bottom: 12px !important;
        flex-direction: row !important; gap: 8px !important;
    }
    body.page-home > div.fixed.bottom-6.right-6 > button { padding: 9px !important; font-size: 13px; }

    /* ---- 公告浮层：底部横条，不再压住「分类导航」按钮 ---- */
    #announcement-toast {
        top: auto !important; bottom: 68px !important;
        left: 12px !important; right: 12px !important;
        width: auto !important; max-width: none !important;
        padding: 12px 14px !important;
        transform: translateY(160%) !important;
    }
    #announcement-toast.opacity-100 { transform: translateY(0) !important; }
}

/* ---------------- 登录页手机端 ---------------- */
@media (max-width: 640px) {
    body.page-login { padding: 16px !important; }
    body.page-login > .login-card { padding: 28px 22px !important; border-radius: 22px !important; }
    body.page-login .login-hero-icon { width: 58px; height: 58px; font-size: 23px !important; margin-bottom: 14px !important; }
    body.page-login h1 { font-size: 20px !important; }
    body.page-login form#login-form { margin-top: 4px; }
}

/* ---------------- 滚动条：隐藏但保留滚动能力 ----------------
   滚动条不再占据布局宽度，切换标签、打开弹层时不会因为
   滚动条时有时无导致整页左右晃动。横向容器仍可滑动/触控横滑。 */
html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
* { scrollbar-width: none; }
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* ============================================================
   开启背景图时的「通透模式」
   旧版三层遮挡：背景容器固定 0.3 透明度 + Hero 整块不透明渐变 +
   侧栏/分类卡片/书签卡片纯白。这里把内容层改成半透明玻璃，
   让整张背景图从卡片与间隙里透出来。
   ============================================================ */
body.page-home.has-bg-image {
    --nv-card: rgba(255, 255, 255, .62);
    --nv-glass: rgba(255, 255, 255, .48);
    --nv-line: rgba(255, 255, 255, .62);
    background-color: var(--nv-bg) !important;
    background-image: none !important;
}
body.dark.page-home.has-bg-image {
    --nv-card: rgba(18, 24, 42, .58);
    --nv-glass: rgba(18, 24, 42, .52);
    --nv-line: rgba(255, 255, 255, .16);
}

/* Hero：用很淡的上下渐变代替整块不透明色，中段让图片大面积透出 */
body.page-home.has-bg-image .hero-bg {
    background-color: transparent !important;
    background-image: linear-gradient(180deg,
        rgba(255,255,255,.44) 0%, rgba(255,255,255,.06) 42%, rgba(255,255,255,.30) 100%) !important;
}
body.dark.page-home.has-bg-image .hero-bg {
    background-image: linear-gradient(180deg,
        rgba(9,14,28,.60) 0%, rgba(9,14,28,.16) 42%, rgba(9,14,28,.46) 100%) !important;
}
body.page-home.has-bg-image .hero-inner { text-shadow: 0 1px 12px rgba(255,255,255,.62); }
body.dark.page-home.has-bg-image .hero-inner { text-shadow: 0 1px 14px rgba(0,0,0,.9); }
body.page-home.has-bg-image .hero-pill,
body.page-home.has-bg-image .hero .search-bar {
    background: rgba(255,255,255,.58) !important;
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
}
body.dark.page-home.has-bg-image .hero-pill,
body.dark.page-home.has-bg-image .hero .search-bar { background: rgba(18,24,42,.56) !important; }

/* 主体：卡片玻璃化 */
body.page-home.has-bg-image #sidebar-nav,
body.page-home.has-bg-image #category-container > div[id^="category-"],
body.page-home.has-bg-image #category-container ul[id^="link-list-"] > li,
body.page-home.has-bg-image #current-time-container,
body.page-home.has-bg-image > footer {
    -webkit-backdrop-filter: blur(9px) saturate(135%);
    backdrop-filter: blur(9px) saturate(135%);
}
body.page-home.has-bg-image #category-container > div[id^="category-"] {
    background: rgba(255,255,255,.42) !important;
}
body.dark.page-home.has-bg-image #category-container > div[id^="category-"] {
    background: rgba(18,24,42,.42) !important;
}
body.page-home.has-bg-image #category-container ul[id^="link-list-"] > li {
    background: rgba(255,255,255,.34) !important;
}
body.dark.page-home.has-bg-image #category-container ul[id^="link-list-"] > li {
    background: rgba(18,24,42,.38) !important;
}
body.page-home.has-bg-image #category-container > div[id^="category-"] > div:first-child {
    background: rgba(255,255,255,.18) !important;
}
body.dark.page-home.has-bg-image #category-container > div[id^="category-"] > div:first-child {
    background: rgba(255,255,255,.05) !important;
}
body.page-home.has-bg-image #category-container > div[id^="category-"] > div:first-child > i {
    background: rgba(255,255,255,.76) !important;
}
body.dark.page-home.has-bg-image #category-container > div[id^="category-"] > div:first-child > i {
    background: rgba(255,255,255,.10) !important;
}
body.page-home.has-bg-image > header:not(.hero) { background: rgba(255,255,255,.55) !important; }
body.dark.page-home.has-bg-image > header:not(.hero) { background: rgba(18,24,42,.55) !important; }
body.page-home.has-bg-image > footer { background: rgba(255,255,255,.48) !important; }
body.dark.page-home.has-bg-image > footer { background: rgba(18,24,42,.48) !important; }

/* 两侧留出呼吸空间，背景图边缘也看得见 */
body.page-home.has-bg-image > div.container {
    padding-left: 18px !important;
    padding-right: 18px !important;
}

@media (max-width: 768px) {
    body.page-home.has-bg-image #bg-image-container { background-attachment: scroll !important; }
    body.page-home.has-bg-image > div.container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    body.page-home.has-bg-image .hero-bg {
        background-image: linear-gradient(180deg,
            rgba(255,255,255,.58), rgba(255,255,255,.22) 48%, rgba(255,255,255,.44)) !important;
    }
}
