/* Final solid-background override.
   This file has a new URL, so deployed browsers won't reuse the old cached
   extra.css that still painted the former wallpaper. */

:root,
html,
body,
.md-container,
.md-main,
.md-main__inner {
    background: #eaf5fb !important;
    background-color: #eaf5fb !important;
    background-image: none !important;
}

body,
body.zdd-minimal-layout,
body.home-layout,
body.blog-index-layout,
body.tag-layout,
body.article-layout {
    background: #eaf5fb !important;
    background-color: #eaf5fb !important;
    background-image: none !important;
}

body::before,
body::after,
body.zdd-minimal-layout::before,
body.zdd-minimal-layout::after,
.md-container::before,
.md-container::after,
.md-main::before,
.md-main::after,
.minimal-home::before,
.minimal-home::after {
    content: none !important;
    display: none !important;
    opacity: 0 !important;
    background: none !important;
    background-image: none !important;
}

body.zdd-minimal-layout .md-container,
body.zdd-minimal-layout .md-main,
body.zdd-minimal-layout .md-main__inner,
body.zdd-minimal-layout .md-content__inner,
body.zdd-minimal-layout .md-typeset,
.minimal-home,
.minimal-home-hero,
.minimal-recent {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

[data-md-color-scheme="slate"],
[data-md-color-scheme="slate"] html,
[data-md-color-scheme="slate"] body,
[data-md-color-scheme="slate"] .md-container,
[data-md-color-scheme="slate"] .md-main,
[data-md-color-scheme="slate"] .md-main__inner,
body[data-md-color-scheme="slate"],
body[data-md-color-scheme="slate"].zdd-minimal-layout,
body[data-md-color-scheme="slate"].home-layout,
body[data-md-color-scheme="slate"].blog-index-layout,
body[data-md-color-scheme="slate"].tag-layout,
body[data-md-color-scheme="slate"].article-layout {
    background: #101924 !important;
    background-color: #101924 !important;
    background-image: none !important;
}

body.article-layout .md-content,
body.zdd-minimal-layout.article-layout .md-content {
    background-color: rgba(255, 255, 255, 0.94) !important;
    background-image: none !important;
}

body.article-layout[data-md-color-scheme="slate"] .md-content,
[data-md-color-scheme="slate"] body.article-layout .md-content,
body[data-md-color-scheme="slate"].article-layout .md-content {
    background-color: rgba(30, 32, 48, 0.92) !important;
    background-image: none !important;
}
/* Compact, unified cards and navigation */
:root {
    --zdd-surface: rgba(247, 252, 255, 0.96);
    --zdd-surface-hover: rgba(255, 255, 255, 0.985);
    --zdd-surface-border: rgba(94, 159, 199, 0.42);
    --zdd-surface-shadow: 0 8px 24px rgba(18, 70, 104, 0.12);
    --zdd-surface-ink: #183746;
    --zdd-surface-muted: #4a6a78;
    --zdd-nav-bg: #d8edf6;
    --zdd-nav-ink: #214c5d;
    --zdd-scroll-thumb: #86b9cf;
    --zdd-scroll-track: rgba(33, 76, 93, 0.08);
}

.md-header,
.md-tabs {
    background: var(--zdd-nav-bg) !important;
    color: var(--zdd-nav-ink) !important;
    box-shadow: 0 1px 10px rgba(24, 55, 70, 0.08) !important;
}

.md-tabs,
.md-search,
.md-header__source {
    display: none !important;
}

.md-header__inner {
    min-height: 3rem !important;
    gap: 0.3rem;
}

.md-header__title {
    flex: 1 1 auto !important;
    margin-left: 0.25rem !important;
}

.md-header__topic + .md-header__topic {
    display: none !important;
}

.md-header__button,
.md-logo,
.md-header__title {
    color: var(--zdd-nav-ink) !important;
}

.zdd-header-nav {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-left: 0.25rem;
    white-space: nowrap;
}

.zdd-header-nav a,
.zdd-header-nav button {
    color: var(--zdd-nav-ink);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    opacity: 0.82;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.zdd-header-nav button {
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

.zdd-header-nav a:hover,
.zdd-header-nav button:hover {
    opacity: 1;
    transform: translateY(-1px);
}

@media screen and (max-width: 48em) {
    .zdd-header-nav {
        gap: 0.55rem;
    }

    .zdd-header-nav a,
    .zdd-header-nav button {
        font-size: 0.7rem;
    }
}

body[data-md-color-scheme="slate"],
[data-md-color-scheme="slate"] {
    --zdd-surface: rgba(25, 38, 52, 0.94);
    --zdd-surface-hover: rgba(31, 48, 65, 0.98);
    --zdd-surface-border: rgba(111, 160, 190, 0.34);
    --zdd-surface-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
    --zdd-surface-ink: #d8e8ef;
    --zdd-surface-muted: #9fb8c4;
    --zdd-nav-bg: #172637;
    --zdd-nav-ink: #d6e8ef;
    --zdd-scroll-thumb: #4f7488;
    --zdd-scroll-track: rgba(214, 232, 239, 0.08);
}

body.zdd-theme-ocean {
    --zdd-surface: rgba(238, 251, 255, 0.97);
    --zdd-surface-hover: rgba(248, 254, 255, 0.99);
    --zdd-surface-border: rgba(76, 164, 188, 0.45);
    --zdd-surface-ink: #163a45;
    --zdd-surface-muted: #4b7480;
    --zdd-nav-bg: #d5f0f5;
    --zdd-nav-ink: #1c5968;
    --zdd-scroll-thumb: #72b8c9;
}

body.zdd-theme-terminal {
    --zdd-surface: rgba(19, 34, 32, 0.94);
    --zdd-surface-hover: rgba(24, 45, 42, 0.98);
    --zdd-surface-border: rgba(88, 183, 151, 0.38);
    --zdd-surface-ink: #d7f7e9;
    --zdd-surface-muted: #9ccdb8;
    --zdd-nav-bg: #10211f;
    --zdd-nav-ink: #d7f7e9;
    --zdd-scroll-thumb: #4b8f79;
}

body.zdd-theme-cat {
    --zdd-surface: rgba(255, 248, 250, 0.97);
    --zdd-surface-hover: rgba(255, 253, 254, 0.99);
    --zdd-surface-border: rgba(218, 145, 169, 0.42);
    --zdd-surface-ink: #432934;
    --zdd-surface-muted: #805c6b;
    --zdd-nav-bg: #f8dfe8;
    --zdd-nav-ink: #673746;
    --zdd-scroll-thumb: #d79aaa;
}

body.zdd-minimal-layout .md-header,
body.zdd-minimal-layout .md-tabs {
    background: var(--zdd-nav-bg) !important;
    color: var(--zdd-nav-ink) !important;
    box-shadow: 0 1px 10px rgba(24, 55, 70, 0.08) !important;
}

body.zdd-minimal-layout .md-header__title,
body.zdd-minimal-layout .md-tabs__link,
body.zdd-minimal-layout .md-header__button,
body.zdd-minimal-layout .md-logo,
body.zdd-minimal-layout .md-source {
    color: var(--zdd-nav-ink) !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--zdd-scroll-track) !important;
}

::-webkit-scrollbar-thumb {
    background: var(--zdd-scroll-thumb) !important;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6ea8c0 !important;
}

body[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb:hover {
    background: #668da0 !important;
}

body.zdd-minimal-layout .md-source-file,
body.zdd-minimal-layout .md-content__button,
body.zdd-minimal-layout a.md-content__button,
body.blog-index-layout .md-typeset > a.md-content__button,
body.home-layout .md-source-file,
body.home-layout .md-content__button,
body.home-layout .md-content__inner > .md-source-file,
body.home-layout .md-typeset > .md-source-file {
    display: none !important;
}

.minimal-search {
    width: min(860px, calc(100vw - 2rem)) !important;
}

.minimal-search input {
    height: 2.75rem !important;
    border-radius: 8px !important;
    background: var(--zdd-surface) !important;
    color: var(--zdd-surface-ink) !important;
    border: 1px solid var(--zdd-surface-border) !important;
    box-shadow: var(--zdd-surface-shadow) !important;
    font-size: 0.92rem !important;
}

.minimal-search input::placeholder {
    color: var(--zdd-surface-muted) !important;
    opacity: 0.82 !important;
}

.minimal-search-results {
    width: min(860px, calc(100vw - 2rem)) !important;
    margin-top: 0.42rem !important;
}

.minimal-search-ghost {
    width: min(860px, calc(100vw - 2rem)) !important;
    min-height: 1.15rem;
    margin: 0.32rem auto 0 !important;
    color: var(--zdd-surface-muted) !important;
    font-family: var(--md-code-font-family);
    font-size: 0.72rem !important;
    line-height: 1.25;
    text-align: left;
    opacity: 0.62;
    pointer-events: none;
}

.minimal-search-ghost[hidden] {
    display: block !important;
    visibility: hidden;
}

.zdd-global-search[hidden] {
    display: none !important;
}

.zdd-global-search {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: grid;
    align-items: start;
    justify-items: center;
    padding: clamp(5rem, 18vh, 8rem) 1rem 2rem;
}

.zdd-global-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 28, 35, 0.34);
    backdrop-filter: blur(3px);
}

.zdd-global-search-dialog {
    position: relative;
    width: min(900px, calc(100vw - 2rem));
}

.zdd-global-search .minimal-search,
.zdd-global-search .minimal-search-results,
.zdd-global-search .minimal-search-ghost {
    width: 100% !important;
}

.zdd-global-search .minimal-search input {
    background: var(--zdd-surface) !important;
}

body.zdd-search-open {
    overflow: hidden;
}

.zdd-command-panel {
    margin-top: 0.42rem;
    padding: 0.55rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 10px;
    background: var(--zdd-surface);
    color: var(--zdd-surface-ink);
    box-shadow: var(--zdd-surface-shadow);
}

.zdd-command-prompt,
.zdd-command-hint {
    color: var(--zdd-surface-muted);
    font-size: 0.68rem;
    line-height: 1.4;
    padding: 0.15rem 0.25rem 0.45rem;
}

.zdd-command-hint {
    padding: 0.45rem 0.25rem 0.1rem;
}

.zdd-command-row {
    width: 100%;
    min-height: 2.65rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--zdd-surface-ink);
    text-align: left;
    cursor: pointer;
}

.zdd-command-row:hover,
.zdd-command-row.is-active {
    background: var(--zdd-surface-hover);
    border-color: var(--zdd-surface-border);
}

.zdd-command-main,
.zdd-command-side {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.zdd-command-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--zdd-surface-ink);
    font-family: var(--md-code-font-family);
}

.zdd-command-desc,
.zdd-command-syntax,
.zdd-command-kind,
.zdd-command-empty {
    color: var(--zdd-surface-muted);
    font-size: 0.68rem;
    line-height: 1.35;
}

.zdd-command-side {
    align-items: flex-end;
}

.zdd-command-kind {
    padding: 0.08rem 0.45rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 999px;
}

.zdd-command-syntax {
    font-family: var(--md-code-font-family);
    white-space: nowrap;
}

.zdd-command-output-title {
    padding: 0.1rem 0.25rem 0.55rem;
    color: var(--zdd-surface-ink);
    font-size: 0.9rem;
    font-weight: 800;
}

.zdd-command-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.45rem;
}

.zdd-command-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.55rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 8px;
    background: var(--zdd-surface-hover);
}

.zdd-command-stat b {
    color: var(--zdd-surface-ink);
    font-size: 0.9rem;
}

.zdd-command-stat small {
    color: var(--zdd-surface-muted);
    font-size: 0.64rem;
}

.zdd-command-posts {
    display: grid;
    gap: 0.45rem;
}

.zdd-command-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.zdd-command-chip {
    padding: 0.24rem 0.55rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 999px;
    color: var(--zdd-surface-ink) !important;
    background: var(--zdd-surface-hover);
    font-size: 0.7rem;
}

.zdd-tex-preview {
    min-height: 3rem;
    display: grid;
    place-items: center;
    padding: 1rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 8px;
    background: var(--zdd-surface-hover);
    overflow-x: auto;
}

.zdd-log-list {
    display: grid;
    gap: 0.45rem;
}

.zdd-log-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.12rem 0.6rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 8px;
    background: var(--zdd-surface-hover);
    color: var(--zdd-surface-ink) !important;
    text-decoration: none !important;
}

.zdd-log-row span,
.zdd-log-row small {
    color: var(--zdd-surface-muted);
    font-size: 0.66rem;
}

.zdd-log-row b {
    min-width: 0;
    color: var(--zdd-surface-ink);
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zdd-log-row small {
    grid-column: 2;
}

.zdd-ip-value {
    padding: 0.65rem;
    border: 1px solid var(--zdd-surface-border);
    border-radius: 8px;
    background: var(--zdd-surface-hover);
    color: var(--zdd-surface-ink);
    font-family: var(--md-code-font-family);
    font-size: 0.95rem;
}

.zdd-kill-screen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    background: #020405;
    color: #d8f1e3;
    font-family: var(--md-code-font-family);
    font-size: clamp(0.85rem, 1.6vw, 1.1rem);
    cursor: pointer;
}

.zdd-kill-box {
    width: min(680px, calc(100vw - 2rem));
    padding: 1.2rem 1.4rem;
    border: 1px solid rgba(216, 241, 227, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
    line-height: 1.8;
}

body.zdd-kill-active {
    overflow: hidden !important;
}

@media screen and (max-width: 44em) {
    .zdd-command-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .zdd-command-side {
        align-items: flex-start;
    }
}

.zdd-post-card,
.zdd-catalog-folder,
.md-typeset a.zdd-search-result,
.zdd-search-result {
    background: var(--zdd-surface) !important;
    color: var(--zdd-surface-ink) !important;
    border: 1px solid var(--zdd-surface-border) !important;
    box-shadow: var(--zdd-surface-shadow) !important;
}

.zdd-post-card:hover,
.zdd-catalog-folder[open],
.md-typeset a.zdd-search-result:hover,
.zdd-search-result:hover {
    background: var(--zdd-surface-hover) !important;
}

.zdd-post-card {
    padding: 1rem 1.15rem !important;
}

.zdd-post-title,
.zdd-folder-name,
.zdd-search-title {
    color: var(--zdd-surface-ink) !important;
    font-size: 1rem !important;
    line-height: 1.35 !important;
}

.zdd-post-preview {
    color: var(--zdd-surface-muted) !important;
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.zdd-post-meta,
.zdd-folder-meta,
.zdd-search-meta {
    color: var(--zdd-surface-muted) !important;
    font-size: 0.72rem !important;
    line-height: 1.4 !important;
}

.zdd-catalog-folder summary {
    padding: 0.82rem 1rem !important;
}

.zdd-catalog-folder > summary {
    align-items: center !important;
    min-height: 2.8rem !important;
    padding-left: 1.05rem !important;
    padding-right: 2.05rem !important;
    position: relative !important;
}

.zdd-catalog-folder > summary::before {
    content: none !important;
    display: none !important;
}

.zdd-catalog-folder > summary::after {
    top: 50% !important;
    right: 0.9rem !important;
    margin-top: -0.45rem !important;
}

.zdd-tag-cloud a,
.zdd-tag-chip {
    color: var(--zdd-surface-muted) !important;
    border-color: var(--zdd-surface-border) !important;
    background: rgba(255, 255, 255, 0.26) !important;
    font-size: 0.72rem !important;
}

.zdd-tag-page .zdd-tag-cloud {
    margin-top: 2rem !important;
}

body[data-md-color-scheme="slate"] .zdd-tag-cloud a,
body[data-md-color-scheme="slate"] .zdd-tag-chip {
    background: rgba(25, 38, 52, 0.55) !important;
}

body[data-md-color-scheme="slate"] .minimal-recent h2,
body[data-md-color-scheme="slate"] .zdd-tag-heading {
    color: #a9c3ce !important;
    text-shadow: none !important;
}

/* Dark-mode catalog and article TOC fixes */
body[data-md-color-scheme="slate"].blog-index-layout .zdd-catalog-folder,
body[data-md-color-scheme="slate"].blog-index-layout .zdd-catalog-folder[open],
body[data-md-color-scheme="slate"].blog-index-layout .zdd-catalog-folder[data-level="1"],
body[data-md-color-scheme="slate"].blog-index-layout .zdd-catalog-folder[data-level="2"],
body[data-md-color-scheme="slate"].blog-index-layout .zdd-catalog-posts .zdd-post-card,
body[data-md-color-scheme="slate"].tag-layout .zdd-post-card {
    background: var(--zdd-surface) !important;
    color: var(--zdd-surface-ink) !important;
    border-color: var(--zdd-surface-border) !important;
    box-shadow: var(--zdd-surface-shadow) !important;
}

body[data-md-color-scheme="slate"].blog-index-layout .zdd-folder-content,
body[data-md-color-scheme="slate"].blog-index-layout .zdd-folder-content > div {
    background: transparent !important;
}

body[data-md-color-scheme="slate"].blog-index-layout .zdd-folder-name,
body[data-md-color-scheme="slate"].blog-index-layout .zdd-post-title,
body[data-md-color-scheme="slate"].tag-layout .zdd-post-title {
    color: var(--zdd-surface-ink) !important;
}

body[data-md-color-scheme="slate"].blog-index-layout .zdd-folder-meta,
body[data-md-color-scheme="slate"].blog-index-layout .zdd-post-preview,
body[data-md-color-scheme="slate"].blog-index-layout .zdd-post-meta,
body[data-md-color-scheme="slate"].tag-layout .zdd-post-preview,
body[data-md-color-scheme="slate"].tag-layout .zdd-post-meta {
    color: var(--zdd-surface-muted) !important;
}

body[data-md-color-scheme="slate"].blog-index-layout .md-typeset h1 {
    color: var(--zdd-surface-muted) !important;
}

body[data-md-color-scheme="slate"].article-layout .md-sidebar--secondary .md-nav--secondary,
body[data-md-color-scheme="slate"].article-layout .md-sidebar--secondary .md-sidebar__scrollwrap {
    background: var(--zdd-surface) !important;
    color: var(--zdd-surface-ink) !important;
    border: 1px solid var(--zdd-surface-border) !important;
    box-shadow: var(--zdd-surface-shadow) !important;
}

body[data-md-color-scheme="slate"].article-layout .md-sidebar--secondary .md-nav__title,
body[data-md-color-scheme="slate"].article-layout .md-sidebar--secondary .md-nav__link,
body[data-md-color-scheme="slate"].article-layout .md-sidebar--secondary .md-nav__item {
    color: var(--zdd-surface-ink) !important;
}

body[data-md-color-scheme="slate"].article-layout .md-sidebar--secondary .md-nav__link:hover,
body[data-md-color-scheme="slate"].article-layout .md-sidebar--secondary .md-nav__link--active {
    color: #f1fbff !important;
}

/* Final polish overrides */
body.blog-index-layout .zdd-catalog-folder > summary::before,
body.blog-index-layout .zdd-catalog-folder > summary .twemoji,
body.blog-index-layout .zdd-catalog-folder > summary .md-icon {
    content: none !important;
    display: none !important;
}

body.blog-index-layout .zdd-catalog-folder > summary {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    min-height: 2.8rem !important;
    padding: 0.62rem 2.05rem 0.62rem 1.05rem !important;
}

body.blog-index-layout .zdd-catalog-folder > summary::after {
    top: 50% !important;
    right: 0.9rem !important;
    margin-top: -0.45rem !important;
}

[data-md-color-scheme="slate"] body.home-layout .zdd-post-card,
body[data-md-color-scheme="slate"].home-layout .zdd-post-card,
[data-md-color-scheme="slate"] body.home-layout .minimal-search input,
body[data-md-color-scheme="slate"].home-layout .minimal-search input,
[data-md-color-scheme="slate"] body.home-layout .md-typeset a.zdd-search-result,
body[data-md-color-scheme="slate"].home-layout .md-typeset a.zdd-search-result {
    background: var(--zdd-surface) !important;
    color: var(--zdd-surface-ink) !important;
    border-color: var(--zdd-surface-border) !important;
    box-shadow: var(--zdd-surface-shadow) !important;
}

[data-md-color-scheme="slate"] body.home-layout .zdd-post-title,
body[data-md-color-scheme="slate"].home-layout .zdd-post-title,
[data-md-color-scheme="slate"] body.home-layout .zdd-search-title,
body[data-md-color-scheme="slate"].home-layout .zdd-search-title {
    color: var(--zdd-surface-ink) !important;
}

[data-md-color-scheme="slate"] body.home-layout .zdd-post-preview,
[data-md-color-scheme="slate"] body.home-layout .zdd-post-meta,
[data-md-color-scheme="slate"] body.home-layout .zdd-search-meta,
body[data-md-color-scheme="slate"].home-layout .zdd-post-preview,
body[data-md-color-scheme="slate"].home-layout .zdd-post-meta,
body[data-md-color-scheme="slate"].home-layout .zdd-search-meta {
    color: var(--zdd-surface-muted) !important;
}

body.article-layout .md-sidebar--secondary .md-sidebar__scrollwrap,
[data-md-color-scheme="slate"] body.article-layout .md-sidebar--secondary .md-sidebar__scrollwrap,
body[data-md-color-scheme="slate"].article-layout .md-sidebar--secondary .md-sidebar__scrollwrap {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

[data-md-color-scheme="slate"] body.article-layout .md-sidebar--secondary .md-nav--secondary,
body[data-md-color-scheme="slate"].article-layout .md-sidebar--secondary .md-nav--secondary {
    background: var(--zdd-surface) !important;
    color: var(--zdd-surface-ink) !important;
    border: 1px solid var(--zdd-surface-border) !important;
    box-shadow: var(--zdd-surface-shadow) !important;
}

.zdd-blog-catalog {
    gap: 0.55rem !important;
}

.zdd-catalog-folder {
    margin-top: 0 !important;
}

.zdd-folder-content {
    display: block !important;
    height: 0;
    overflow: hidden;
    transition: height 260ms ease;
}

.zdd-catalog-folder[open] > .zdd-folder-content {
    height: auto;
}

.zdd-folder-content > div {
    padding: 0 0.8rem !important;
}

.zdd-catalog-folder[open] > .zdd-folder-content > div {
    padding-bottom: 0.8rem !important;
}

.zdd-catalog-folder[open] > .zdd-folder-content > div > .zdd-catalog-folder:first-child,
.zdd-catalog-folder[open] > .zdd-folder-content > div > .zdd-catalog-posts:first-child {
    margin-top: 0.75rem !important;
}

.zdd-folder-content > div > .zdd-catalog-folder + .zdd-catalog-folder,
.zdd-folder-content > div > .zdd-catalog-folder + .zdd-catalog-posts,
.zdd-folder-content > div > .zdd-catalog-posts + .zdd-catalog-folder {
    margin-top: 0.7rem !important;
}

.zdd-catalog-posts {
    gap: 0.6rem !important;
    margin-top: 0.55rem !important;
}

/* Back to top button: center top */
.md-top,
[dir="ltr"] .md-top,
[dir="rtl"] .md-top {
    position: fixed !important;

    /* 先清掉主题默认的物理/逻辑定位 */
    inset: auto !important;
    inset-inline-start: auto !important;
    inset-inline-end: auto !important;

    /* 再重新指定位置 */
    top: 3.15rem !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;

    margin: 0 !important;
    transform: translateX(-50%) !important;

    width: max-content !important;
    min-width: 0 !important;
    max-width: calc(100vw - 2rem) !important;
    height: 2.4rem !important;
    min-height: 0 !important;
    padding: 0.42rem 0.9rem !important;
    border-radius: 999px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;

    white-space: nowrap !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    overflow: hidden !important;
    z-index: 8 !important;
}

.md-top[hidden],
[dir="ltr"] .md-top[hidden],
[dir="rtl"] .md-top[hidden] {
    display: none !important;
}

/* Disable heavy theme transitions */
html,
body,
.md-container,
.md-main,
.md-main__inner,
.md-content,
.md-content__inner,
.md-header,
.md-tabs,
.md-typeset,
.md-sidebar,
.md-nav,
.md-nav__link,
.zdd-post-card,
.zdd-catalog-folder,
.zdd-search-result,
.minimal-search input,
.md-sidebar--secondary .md-nav--secondary {
    transition: none !important;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Smooth visual fade for theme switching */
html.zdd-theme-fading::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    background: var(--zdd-theme-fade-bg, #eaf5fb);
    opacity: 1;
    animation: zdd-theme-fade-out 220ms ease forwards;
}

@keyframes zdd-theme-fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
