/* ------------------
 * Global style
 * --------------- */

/* 全局文字选中样式 */
::selection {
    background: rgb(var(--mdui-color-primary-container)) !important;
    color: rgb(var(--mdui-color-on-primary-container)) !important;
}
a {
    color: rgb(var(--mdui-color-primary));
    text-decoration: none;
}

a:hover {
    color: rgb(var(--mdui-color-primary-container-light));
    text-decoration: underline;
}

.mdui-card-primary-title {
    font-family: 'Smiley';
}
@font-face {
    font-family: 'Smiley';
    src: url('./fonts/SmileySans-Oblique.ttf.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'AlimamaFangYuanTiVF';
    src: url('./fonts/AlimamaFangYuanTiVF-Thin-2.woff2') format('woff2');
    font-display: swap;
}
body {
    font-family: Roboto, "Noto Sans SC", "PingFang SC", "Lantinghei SC", "Microsoft Yahei", "Hiragino Sans GB", "Microsoft Sans Serif", "WenQuanYi Micro Hei", sans-serif;
}

.scrollToTopBtn-wrapper {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 100;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(80px) scale(0.6);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scrollToTopBtn-wrapper.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 阅读进度环：方圆形，贴合 mdui-fab 轮廓，在 FAB 内圈显示 */
.reading-progress-ring {
    position: absolute;
    inset: 0; /* 紧贴 FAB 内边缘，不留空隙 */
    border-radius: var(--mdui-shape-corner-large);
    background: conic-gradient(
        rgba(var(--mdui-color-on-primary-container), 0.7) var(--progress, 0deg),
        rgba(var(--mdui-color-on-surface), 0.08) 0deg
    );
    pointer-events: none;
    z-index: 2; /* 在 FAB 上方 */
    padding: 3px; /* 环宽 */
    -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000) padding-box;
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000) padding-box;
    mask-composite: exclude;
    transition: background 0.1s linear;
}

.divider svg path {
    stroke: rgb(var(--mdui-color-surface-variant));
}

.main-index-title {
    display: block;
    margin: 0 auto 0 40px;
    max-width: var(--m3ui-content-width, 1200px);
    line-height: 0.7;
    font-size: 32px;
    font-family: 'Smiley';
}
.main-post-title {
    display: block;
    margin: 0;
    max-width: var(--m3ui-content-width, 1200px);
    font-size: 32px;
}

.post-card .img-invert {
    filter: invert(0%);
    object-fit: cover;
    width: 100%;
    height: 200px;  /* 固定图片高度，避免变形 */
    max-height: 50%; /* 最大不超过卡片高度的50% */
    border-radius: var(--mdui-shape-corner-medium);
    position: relative;
    z-index: 0;
    display: block;
    flex-shrink: 0; /* 图片不压缩 */
}
.post-card-info {
    width: 87%;
    text-align: left;
    margin: 20px auto;
    padding: 0 10px;
    flex-grow: 1; /* 内容区域可扩展 */
    display: flex;
    flex-direction: column;
}
.post-card-info .post-title {
    font-size: 24px;
    font-family: 'AlimamaFangYuanTiVF';
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.post-meta {
    display: flex;
    align-items: center;
    margin-top: 8px;
    font-size: var(--mdui-typescale-label-large-size);
    color: rgb(var(--mdui-color-on-surface-variant));
}
.calendar-icon {
    margin-right: 4px;
}
.tag-none {
    padding: 6px 10px;
    border: .0625rem solid rgb(var(--mdui-color-outline));
    color: rgb(var(--mdui-color-on-surface-variant));
    background-color: rgba(0, 0, 0, 0);
    border-radius: var(--mdui-shape-corner-small);
}
.post-description {
    margin-top: 12px;
    font-size: var(--mdui-typescale-label-large-size);
    font-family: 'AlimamaFangYuanTiVF';
}
.post-description a {
    padding: 6px 10px;
    border: .0625rem solid rgb(var(--mdui-color-outline));
    text-decoration: none;
	outline: none;
	color: rgb(var(--mdui-color-on-surface));
	background-color: rgba(0, 0, 0, 0);
    border-radius: var(--mdui-shape-corner-small);
}
.pageNav {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.pageNav .pagePrev,
.pageNav .pageNext {
    flex: 0 0 auto;
}
.pageNav .page-num {
    min-width: 36px;
}
.pageNav .current {
    --mdui-color-button-container: rgb(var(--mdui-color-primary-container));
    --mdui-color-button-label: rgb(var(--mdui-color-on-primary-container));
}

#comments .comment-list {
    list-style-type: none;
    padding-inline-start: 0;
}


@media screen and (min-width: 1300px) {
    body {
        padding-left: 81px !important;
        padding-top: 0px !important;
    }
    mdui-top-app-bar {
        display: none;
    }
    #header-card {
        display: flex;
        flex-direction: column;
        max-width: 1750px;
        min-width: 1200px;
        max-height: 537.5px;
        min-height: 537.5px;
        margin: 0 auto 120px auto;
        width: 100%;
        height: 100%;
        border-radius: var(--mdui-shape-corner-extra-large);
        position: relative;
        overflow: hidden;
    }
    .img-invert {
        filter: invert(30%);
        object-fit: cover;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 0;
        display: block;
    }
    #header-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    .header-content {
        position: relative;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        z-index: 2;
        padding: 20px;
    }
    
    .img-title {
        font-size: 4rem;
        margin: 0 0 10px 0;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        white-space: normal;
        max-width: 90%;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .img-description {
        font-size: 1.5rem;
        margin: 0;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        white-space: normal;
        max-width: 90%;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #main-index, #main-post {
        margin: auto auto 5rem;
        max-width: var(--m3ui-content-width, 1200px);
    }
    
    .post-content-container {
        display: flex;
        gap: 24px;
        flex-wrap: wrap;
    }
    
    /* 无目录时正文居中 */
    .post-content-container.no-toc {
        justify-content: center;
    }
    
    .post-content-container.no-toc .main-post-content {
        max-width: 100%;
    }
    
    .main-post-content.no-toc {
        max-width: 100%;
    }
    
    .main-post-content {
        flex: 1;
        min-width: 300px;
        max-width: calc(100% - 280px); /* 留出目录的空间 */
        font-size: var(--mdui-typescale-body-large-size);
        line-height: var(--mdui-typescale-body-large-line-height);
        letter-spacing: var(--mdui-typescale-body-large-tracking);
    }
    
    .main-post-content img {
        width: 100%;
        max-width: 100%;
        height: auto;
        border-radius: var(--mdui-shape-corner-medium);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        margin: 8px 0 !important;
        display: block;
        object-fit: cover;
        transition: box-shadow 0.2s ease;
    }
    
    .main-post-content img:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    .collect {
        margin: auto;
        width: 100%;
    }
    .post-grid {
        display: grid;
        grid-template-columns: repeat(var(--post-card-columns, 3), 1fr) !important;
        gap: 16px;
    }
    .post-card {
        min-height: 300px;
        height: auto;
        width: 100%;
        margin: 0;
        font-size: 27px;
        text-align: center;
        border-radius: var(--mdui-shape-corner-medium);
        transition: box-shadow 0.2s ease, outline 0.2s ease;
        outline: 2px solid transparent;
        outline-offset: 2px;
        display: flex;
        flex-direction: column;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid rgba(var(--mdui-color-outline), 0.2);
    }
    .post-card:active, .post-card:focus-within {
        outline: 2px solid rgb(var(--mdui-color-primary));
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
    #footer {
        margin: 0 auto;
        padding-top: 3rem;
        max-width: var(--m3ui-content-width, 1200px);
        height: 25vh;
    }
    #footer a {
        text-decoration: none;
	    color: rgb(var(--mdui-color-primary));
    }
    #footer a:hover {
        text-decoration: underline;
        color: rgb(var(--mdui-color-primary-container-light));
    }
}

/* 平板设备样式 (768px - 1299px) */
@media screen and (min-width: 768px) and (max-width: 1299px) {
    body {
        padding-left: 0px !important;
        padding-top: 64px !important;
    }
    mdui-navigation-rail {
        display: none;
    }
    #header-card {
        display: flex;
        flex-direction: column;
        margin: 0 auto 50px auto;
        width: 95%;
        max-height: 400px;
        min-height: 300px;
        border-radius: var(--mdui-shape-corner-extra-large);
        position: relative;
        overflow: hidden;
    }
    .img-invert {
        filter: invert(30%);
        object-fit: cover;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 0;
        display: block;
    }
    #header-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    .header-content {
        position: relative;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        z-index: 2;
        padding: 20px;
    }
    
    .img-title {
        font-size: 2.5rem;
        margin: 0 0 10px 0;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        white-space: normal;
        max-width: 90%;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .img-description {
        font-size: 1.2rem;
        margin: 0;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        white-space: normal;
        max-width: 90%;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 平板设备归档页面样式 */
    .post-grid {
        grid-template-columns: repeat(min(var(--post-card-columns, 3), 2), 1fr) !important;
        gap: 12px !important;
    }

    .post-card {
        min-height: 280px !important;
    }
}


/* 手机设备样式 (小于768px) */
@media screen and (max-width: 767px) {
    body {
        padding-left: 0px !important;
        padding-top: 64px !important;
    }
    mdui-navigation-rail {
        display: none;
    }
    #header-card {
        display: flex;
        flex-direction: column;
        margin: 0 auto 30px auto;
        width: 95%;
        max-height: 250px;
        min-height: 200px;
        border-radius: var(--mdui-shape-corner-large);
        position: relative;
        overflow: hidden;
    }
    .img-invert {
        filter: invert(30%);
        object-fit: cover;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 0;
        display: block;
    }
    #header-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    .header-content {
        position: relative;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        z-index: 2;
        padding: 15px;
    }
    
    .img-title {
        font-size: 1.8rem;
        margin: 0 0 8px 0;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        white-space: normal;
        max-width: 90%;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .img-description {
        font-size: 1rem;
        margin: 0;
        color: white;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        white-space: normal;
        max-width: 90%;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 移动端归档页面样式 */
    .post-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .post-card {
        min-height: 250px !important;
    }
    
    /* 移动端错误页面样式 */
    .error-card {
        margin: 20px;
        padding: 16px;
    }
    
    .error-content {
        text-align: center;
    }
    
    .error-icon {
        font-size: 48px;
        width: 48px;
        height: 48px;
        color: rgb(var(--mdui-color-error));
        margin-bottom: 16px;
    }
    
    .error-actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin: 24px 0;
    }
    
    .error-actions mdui-button {
        width: 100%;
    }
}

/* 归档页面、标签页面、分类页面样式 */
.archive-title {
    font-size: 28px;
    margin: 20px 0;
    color: rgb(var(--mdui-color-on-surface));
    text-align: center;
}

#main-index {
    margin: auto auto 5rem;
    width: 100%;
    max-width: var(--m3ui-content-width, 1200px);
}
#main-post {
    margin: auto auto 5rem;
    width: 95%;
    max-width: var(--m3ui-content-width, 1200px);
}
.main-post-content img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--mdui-shape-corner-medium);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    margin: 8px 0 !important;
    display: block;
    object-fit: cover;
    transition: box-shadow 0.2s ease;
}

.main-post-content img:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 暗色模式下文章图片降低亮度 */
.mdui-theme-dark .main-post-content img:not(.no-dim):not(.bq) {
    filter: brightness(0.85);
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.mdui-theme-dark .main-post-content img:hover:not(.no-dim):not(.bq) {
    filter: brightness(1);
}

/* auto 模式下跟随系统暗色 */
@media (prefers-color-scheme: dark) {
    .mdui-theme-auto .main-post-content img:not(.no-dim):not(.bq) {
        filter: brightness(0.85);
        transition: filter 0.2s ease, box-shadow 0.2s ease;
    }

    .mdui-theme-auto .main-post-content img:hover:not(.no-dim):not(.bq) {
        filter: brightness(1);
    }
}

.collect {
    margin: auto;
    width: 95%;
}
.post-grid {
    display: grid;
    grid-template-columns: repeat(min(var(--post-card-columns, 3), 2), 1fr);
    gap: 12px;
}
.post-card {
    min-height: 300px;
    height: auto;
    width: 100%;
    margin: 0;
    font-size: 27px;
    text-align: center;
    border-radius: var(--mdui-shape-corner-medium);
    transition: box-shadow 0.2s ease, outline 0.2s ease;
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(var(--mdui-color-outline), 0.2);
}
.post-card:active, .post-card:focus-within {
    outline: 2px solid rgb(var(--mdui-color-primary));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}
#footer {
    margin: 5rem auto;
    width: 95%;
    height: 25vh;
}
#footer a {
    text-decoration: none;
    color: rgb(var(--mdui-color-primary));
}
#footer a:hover {
    text-decoration: underline;
    color: rgb(var(--mdui-color-primary-container-light));
}

/* 标题样式 - 上宽下窄，全局生效 */
.main-post-content h1 {
    margin: 1.6em 0 0.5em !important;
    font-weight: 700;
}

.main-post-content h2 {
    margin: 1.4em 0 0.5em !important;
    font-weight: 600;
}


.main-post-content h3 {
    margin: 1.3em 0 0.4em !important;
    font-weight: 600;
}

.main-post-content h4 {
    margin: 1.2em 0 0.35em !important;
    font-weight: 600;
}

.main-post-content h5 {
    margin: 1em 0 0.3em !important;
    font-weight: 600;
}

.main-post-content h6 {
    margin: 1em 0 0.25em !important;
    font-weight: 600;
    color: rgb(var(--mdui-color-on-surface-variant));
}

@media screen and (max-width: 1299px) {
    .post-content-container {
        flex-direction: column;
    }
    
    .main-post-content {
        max-width: 100%;
        min-width: 100%;
    }
    
    #main-post .post-content-container #toc-container {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 20px 0 !important;
    }
}

/* 评论样式 */
#comments {
    margin: 20px 0;
}

#comments h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.comment-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-grid > mdui-card,
.comment-grid mdui-card.comment-parent,
.comment-children mdui-card {
    width: 100%;
    box-sizing: border-box;
    --mdui-color-surface-container: rgb(var(--mdui-color-surface-container-high));
    background-color: rgb(var(--mdui-color-surface-container-high)) !important;
    border-radius: var(--mdui-shape-corner-large) !important;
    box-shadow: var(--mdui-elevation-level1) !important;
    transition: box-shadow 0.2s ease;
}

.comment-grid > mdui-card:hover,
.comment-grid mdui-card.comment-parent:hover,
.comment-children mdui-card:hover {
    box-shadow: var(--mdui-elevation-level2) !important;
}

.comment-grid mdui-card.comment-awaiting {
    opacity: 0.75;
}

/* 卡片内部布局 */
.comment-grid mdui-card,
.comment-children mdui-card {
    padding: 20px;
}

.comment-inner {
    display: flex;
    gap: 12px;
}

.comment-inner mdui-avatar {
    --mdui-avatar-size: 40px;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 500;
    font-size: 14px;
}

.comment-date {
    font-size: 12px;
    color: rgb(var(--mdui-color-on-surface-variant));
    margin-left: auto;
}

.comment-pending {
    margin-top: 8px;
    color: rgb(var(--mdui-color-warning));
}

.comment-reply {
    margin-top: 8px;
}

/* 子评论区域：嵌套在父卡片内，缩进显示 */
.comment-children {
    margin-top: 16px;
    padding-left: 20px;
    border-left: 3px solid rgb(var(--mdui-color-outline-variant));
}

.comment-children mdui-card {
    margin-bottom: 12px;
}

.comment-children .comment-children {
    margin-left: 0;
}

@media screen and (max-width: 768px) {
    .comment-children {
        padding-left: 16px;
    }
}

/* 评论内容 */
.comment-content {
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    color: rgb(var(--mdui-color-on-surface));
}

.comment-content a {
    color: rgb(var(--mdui-color-primary));
    text-decoration: none;
}

.comment-content a:hover {
    text-decoration: underline;
}

.comment-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--mdui-shape-corner-small);
}

.comment-content p {
    margin: 8px 0;
}

.comment-content pre {
    background: rgb(var(--mdui-color-surface-container-low));
    padding: 12px;
    border-radius: var(--mdui-shape-corner-small);
    overflow-x: auto;
    font-size: 13px;
}

.comment-content code {
    background: rgb(var(--mdui-color-surface-container-high));
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.comment-content blockquote {
    margin: 8px 0;
    padding: 8px 16px;
    border-left: 3px solid rgb(var(--mdui-color-outline-variant));
    color: rgb(var(--mdui-color-on-surface-variant));
}

/* 评论表单样式 */
.respond {
    margin-top: 40px;
}

.comment-user-info {
    padding: 16px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.comment-user-info mdui-avatar {
    --mdui-avatar-size: 40px;
    flex-shrink: 0;
}

#comment-form mdui-text-field {
    width: 100%;
    margin-bottom: 12px;
    display: block;
}

.cancel-comment-reply {
    margin-bottom: 12px;
}

.cancel-comment-reply a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    color: rgb(var(--mdui-color-error));
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--mdui-shape-corner-full);
    background: rgba(var(--mdui-color-error), 0.08);
    transition: background 0.2s ease;
}

.cancel-comment-reply a:hover {
    background: rgba(var(--mdui-color-error), 0.15);
    text-decoration: none;
}

.cancel-comment-reply a:before {
    content: '✕';
    font-size: 12px;
}

#toc-container {
    position: sticky;
    top: 20px;
    width: 280px;
    background: rgb(var(--mdui-color-surface-container-low));
    border-radius: var(--mdui-shape-corner-large);
    padding: 0;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#toc-container .title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 22px 22px;
    color: rgb(var(--mdui-color-on-surface));
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
}

#toc-content.items {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px 8px;
}

#toc-content.items .item {
    --mdui-typescale-label-large-size: 15px;
    color: rgb(var(--mdui-color-on-surface-variant));
    border-radius: var(--mdui-shape-corner-full);
    height: 40px;
    min-height: 40px;
    margin: 2px 0;
    box-sizing: border-box;
    transition: background-color 0.15s ease, color 0.15s ease, outline 0.15s ease;
    outline: 2px solid transparent;
    outline-offset: 2px;
    font-size: 15px;
    letter-spacing: 0.1px;
}

/* 同步内部 a 标签样式 */
#toc-content.items .item::part(container) {
    height: 40px;
    min-height: 40px;
    line-height: 40px;
    padding: 0 16px;
    font-size: 15px;
    letter-spacing: 0.1px;
}

/* h1 标题 - 独立较大样式 */
#toc-content.items .item.item-h1 {
    font-size: 16px;
    font-weight: 700;
    color: rgb(var(--mdui-color-on-surface));
}

#toc-content.items .item.item-h1::part(container) {
    font-size: 16px;
    font-weight: 700;
}

/* h2 标题 - 加粗 */
#toc-content.items .item.item-bold {
    font-weight: 600;
    color: rgb(var(--mdui-color-on-surface));
}

#toc-content.items .item.item-bold::part(container) {
    font-weight: 600;
}

#toc-content.items .item:hover {
    background-color: rgba(var(--mdui-color-primary), 0.08);
    color: rgb(var(--mdui-color-primary));
}

/* 高亮当前活动的目录项 - 添加描边，与文章列表一致 */
#toc-content.items .item.toc-active {
    background-color: var(--mdui-color-secondary-container) !important;
    color: var(--mdui-color-on-secondary-container) !important;
    font-weight: 500;
    outline: 2px solid rgb(var(--mdui-color-primary));
}

/* 目录分隔线 */
#toc-content.items .divider {
    height: 1px;
    background: rgb(var(--mdui-color-outline-variant));
    margin: 8px 12px;
}

/* 移动端：目录在 post-meta-row 下方 */
@media screen and (max-width: 1299px) {
    #toc-container {
        position: static;
        width: 100%;
        max-height: none;
        margin-bottom: 20px;
    }

    #toc-content.items {
        max-height: 240px;
        overflow-y: auto;
    }
}

/* 小屏幕移动端：统一样式 */
@media screen and (max-width: 480px) {
    #toc-content.items .item {
        font-size: 14px;
    }

    #toc-content.items .item::part(container) {
        font-size: 14px;
    }

    #toc-content.items .item.item-h1 {
        font-size: 15px;
    }

    #toc-content.items .item.item-h1::part(container) {
        font-size: 15px;
    }
}

/* 首页文章卡片元数据样式 */
.post-card .post-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 24px;
}

.post-card .post-meta-chips mdui-chip {
    --mdui-chip-label-text-size: 12px;
    --mdui-chip-leading-icon-size: 14px;
}

/* 文章元数据行样式 */
.post-meta-row {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    align-items: center;
    flex-wrap: wrap;
}

.post-meta-row mdui-chip {
    --mdui-chip-label-text-size: 14px;
    --mdui-chip-leading-icon-size: 16px;
    text-decoration: none !important;
}

.post-meta-row mdui-chip a {
    text-decoration: none !important;
    color: inherit !important;
}

.post-meta-row mdui-chip a:hover {
    text-decoration: none !important;
    color: inherit !important;
}

/* 文章分享按钮 */
.post-share {
    margin-left: auto;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

@media screen and (max-width: 767px) {
    .post-share mdui-button-icon {
        --mdui-button-icon-size: 36px;
    }
}

/* 全站搜索对话框 */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.search-form .search-input-field {
    width: 100%;
}

.search-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

@media screen and (max-width: 400px) {
    .search-form {
        padding: 16px;
        gap: 16px;
        max-width: 100%;
    }
}

/* 文章上下篇导航 */
.post-near {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
    max-width: 100%;
    box-sizing: border-box;
}

.post-near-card {
    padding: 16px;
    box-sizing: border-box;
    min-width: 0;
    display: flex;
    align-items: center;
    transition: box-shadow 0.2s ease;
}

.post-near-card:not(.post-near-disabled) {
    cursor: pointer;
}

.post-near-card:not(.post-near-disabled):hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.post-near-disabled {
    opacity: 0.45;
}

.post-near-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.post-near-icon {
    font-size: 20px;
    color: rgb(var(--mdui-color-primary));
    flex-shrink: 0;
}

.post-near-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: var(--mdui-shape-corner-small, 8px);
    overflow: hidden;
    background: rgb(var(--mdui-color-surface-container-high));
}

.post-near-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-near-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.post-near-label {
    font-size: 12px;
    color: rgb(var(--mdui-color-on-surface-variant));
}

.post-near-title {
    font-size: 15px;
    font-weight: 500;
    color: rgb(var(--mdui-color-on-surface));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-near-next .post-near-info {
    align-items: stretch;
    text-align: right;
}

@media screen and (max-width: 768px) {
    .post-near {
        grid-template-columns: 1fr;
    }
}

/* Prism代码块样式 - MDUI重置 */
pre[class*="language-"],
pre[data-language] {
    background: rgb(var(--mdui-color-surface-container-high)) !important;
    border-radius: var(--mdui-shape-corner-large) !important;
    padding: 0 !important;
    margin: 24px 0 !important;
    overflow: hidden !important;
    position: relative !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgb(var(--mdui-color-outline-variant)) !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', Consolas, monospace !important;
}

pre[class*="language-"] > code,
pre[data-language] > code {
    display: block !important;
    padding: 48px 24px 8px !important;
    overflow-x: auto !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    tab-size: 4 !important;
    color: rgb(var(--mdui-color-on-surface)) !important;
    background: transparent !important;
}

/* 代码块顶部标签栏 */
pre[data-language]::before {
    content: attr(data-language) !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: rgb(var(--mdui-color-surface-container-highest)) !important;
    color: rgb(var(--mdui-color-on-surface-variant)) !important;
    padding: 10px 24px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border-bottom: 1px solid rgb(var(--mdui-color-outline-variant)) !important;
    font-family: system-ui, -apple-system, sans-serif !important;
}

/* 代码块复制按钮 */
.code-copy-btn {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

pre:hover .code-copy-btn {
    opacity: 1;
}

/* Snackbar 跟随暗色模式 */
mdui-snackbar {
    background-color: rgb(var(--mdui-color-surface-container-high)) !important;
    color: rgb(var(--mdui-color-on-surface)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* 行内代码 */
:not(pre) > code[class*="language-"] {
    background: rgb(var(--mdui-color-surface-container)) !important;
    color: rgb(var(--mdui-color-primary)) !important;
    padding: 3px 8px !important;
    border-radius: var(--mdui-shape-corner-small) !important;
    font-size: 0.9em !important;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace !important;
    border: 1px solid rgb(var(--mdui-color-outline-variant)) !important;
}

/* Prism Token颜色 - MDUI配色 */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: rgb(var(--mdui-color-outline)) !important;
    font-style: italic !important;
}

.token.punctuation {
    color: rgb(var(--mdui-color-on-surface-variant)) !important;
}

.token.namespace {
    opacity: 0.7 !important;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: rgb(var(--mdui-color-error)) !important;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: rgb(var(--mdui-color-tertiary)) !important;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
    color: rgb(var(--mdui-color-primary)) !important;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: rgb(var(--mdui-color-secondary)) !important;
}

.token.function {
    color: rgb(var(--mdui-color-primary)) !important;
    font-weight: 500 !important;
}

.token.class-name {
    color: rgb(var(--mdui-color-tertiary)) !important;
}

.token.regex,
.token.important,
.token.annotation {
    color: rgb(var(--mdui-color-tertiary)) !important;
}

.token.important,
.token.bold {
    font-weight: bold !important;
}

.token.italic {
    font-style: italic !important;
}

.token.entity {
    cursor: help !important;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 16px 0;
    background: rgb(var(--mdui-color-surface));
    border-radius: var(--mdui-shape-corner-medium);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-right: 1px solid rgb(var(--mdui-color-outline-variant));
    border-bottom: 1px solid rgb(var(--mdui-color-outline-variant));
}

th:last-child, td:last-child {
    border-right: none;
}

/* 根据align属性设置对齐方式 */
th[align="left"], td[align="left"] {
    text-align: left;
}

th[align="center"], td[align="center"] {
    text-align: center;
}

th[align="right"], td[align="right"] {
    text-align: right;
}

th {
    background: rgb(var(--mdui-color-surface-container-highest));
    font-weight: 500;
    color: rgb(var(--mdui-color-on-surface));
    font-size: var(--mdui-typescale-label-large-size);
}

td {
    color: rgb(var(--mdui-color-on-surface-variant));
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: rgb(var(--mdui-color-surface-container-high));
}

/* 引用块样式 */
blockquote {
    margin: 0 !important;
    padding: 16px 24px;
    border-left: 4px solid rgb(var(--mdui-color-primary));
    background: rgb(var(--mdui-color-surface-container));
    border-radius: var(--mdui-shape-corner-medium);
    font-style: italic;
    color: rgb(var(--mdui-color-on-surface-variant));
    position: relative;
}

blockquote p {
    margin: 8px 0;
}

blockquote p:first-child {
    margin-top: 0;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* 文本样式 */
strong, b {
    font-weight: var(--mdui-typescale-body-large-weight);
    color: rgb(var(--mdui-color-on-surface));
}

em, i {
    font-style: italic;
    color: rgb(var(--mdui-color-on-surface-variant));
}

strong em, em strong, b i, i b {
    font-weight: var(--mdui-typescale-body-large-weight);
    font-style: italic;
    color: rgb(var(--mdui-color-on-surface));
}

/* 列表样式 */
ul, ol {
    margin: 16px 0;
    padding-left: 32px;
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

li {
    margin: 8px 0;
    line-height: 1.6;
    color: rgb(var(--mdui-color-on-surface));
}

ul ul, ol ul {
    list-style-type: circle;
    margin-top: 4px;
    margin-bottom: 4px;
}

ol ol, ul ol {
    list-style-type: lower-alpha;
    margin-top: 4px;
    margin-bottom: 4px;
}

/* 文章内容中的列表样式 */
.post-content-container li {
    margin: 6px 0;
}

@media screen and (max-width: 767px) {
    .post-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .post-card {
        min-height: 300px;
        height: auto;
    }
}

/* Spotlight 图片查看器 - MDUI 主题适配 */
#spotlight {
    position: fixed !important;
    z-index: 2147483647 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
    box-sizing: border-box !important;
    transform: none !important;
    contain: layout style !important;
    will-change: auto !important;
    isolation: isolate !important;
    /* 使用 MDUI scrim 颜色作为背景 */
    background-color: rgb(var(--mdui-color-scrim)) !important;
    color: rgb(var(--mdui-color-on-surface)) !important;
    font-family: Roboto, "Noto Sans SC", sans-serif !important;
}

/* 顶部/底部栏：使用 MDUI surface-container 颜色 + 模糊 */
/* 不覆盖 position/transform，保留 Spotlight 默认的 translateY 隐藏机制 */
#spotlight .spl-header,
#spotlight .spl-footer {
    background-color: rgba(var(--mdui-color-surface-container-high), 0.7) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

#spotlight .spl-footer {
    background-color: rgba(var(--mdui-color-surface-container-high), 0.85) !important;
}

/* 控制按钮（关闭、全屏、自适应等） */
#spotlight .spl-header div {
    opacity: 0.7 !important;
    transition: opacity 0.2s ease, background-color 0.2s ease !important;
    border-radius: var(--mdui-shape-corner-full) !important;
}

#spotlight .spl-header div:hover {
    opacity: 1 !important;
    background-color: rgba(var(--mdui-color-primary), 0.12) !important;
}

/* 页码指示器 */
#spotlight .spl-page {
    color: rgb(var(--mdui-color-on-surface-variant)) !important;
    font-size: var(--mdui-typescale-label-large-size) !important;
    font-weight: var(--mdui-typescale-label-large-weight) !important;
    letter-spacing: var(--mdui-typescale-label-large-tracking) !important;
    line-height: 56px !important;
    padding: 0 16px !important;
}

/* 控制图标颜色：使用 MDUI on-surface-variant */
#spotlight .spl-close,
#spotlight .spl-fullscreen,
#spotlight .spl-autofit,
#spotlight .spl-zoom-in,
#spotlight .spl-zoom-out,
#spotlight .spl-theme,
#spotlight .spl-play,
#spotlight .spl-download {
    filter: none !important;
}

/* 反转图标颜色：Spotlight 默认白色图标，在亮色模式下需要反转 */
.mdui-theme-light #spotlight .spl-close,
.mdui-theme-light #spotlight .spl-fullscreen,
.mdui-theme-light #spotlight .spl-autofit,
.mdui-theme-light #spotlight .spl-zoom-in,
.mdui-theme-light #spotlight .spl-zoom-out,
.mdui-theme-light #spotlight .spl-theme,
.mdui-theme-light #spotlight .spl-play,
.mdui-theme-light #spotlight .spl-download,
.mdui-theme-light #spotlight .spl-page ~ *,
.mdui-theme-light #spotlight .spl-prev,
.mdui-theme-light #spotlight .spl-next,
.mdui-theme-light #spotlight .spl-spinner {
    filter: invert(1) !important;
}

/* 导航箭头：使用 MDUI surface-container 背景 + 圆形 */
#spotlight .spl-prev,
#spotlight .spl-next {
    background-color: rgba(var(--mdui-color-surface-container-highest), 0.6) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-radius: var(--mdui-shape-corner-full) !important;
    box-shadow: var(--mdui-elevation-level2) !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease, background-color 0.2s ease !important;
}

#spotlight .spl-prev:hover,
#spotlight .spl-next:hover {
    opacity: 1 !important;
    background-color: rgba(var(--mdui-color-surface-container-highest), 0.9) !important;
}

/* 进度条：使用 MDUI primary 颜色 */
#spotlight .spl-progress {
    background-color: rgb(var(--mdui-color-primary)) !important;
    height: 3px !important;
}

/* 底部标题/描述：使用 MDUI 排版 */
#spotlight .spl-title {
    font-size: var(--mdui-typescale-title-large-size) !important;
    font-weight: var(--mdui-typescale-title-large-weight) !important;
    line-height: var(--mdui-typescale-title-large-line-height) !important;
    color: rgb(var(--mdui-color-on-surface)) !important;
}

#spotlight .spl-description {
    font-size: var(--mdui-typescale-body-medium-size) !important;
    line-height: var(--mdui-typescale-body-medium-line-height) !important;
    color: rgb(var(--mdui-color-on-surface-variant)) !important;
}

/* 底部按钮：使用 MDUI filled button 风格 */
#spotlight .spl-button {
    background-color: rgb(var(--mdui-color-primary)) !important;
    color: rgb(var(--mdui-color-on-primary)) !important;
    border-radius: var(--mdui-shape-corner-full) !important;
    padding: 10px 24px !important;
    font-size: var(--mdui-typescale-label-large-size) !important;
    font-weight: var(--mdui-typescale-label-large-weight) !important;
    letter-spacing: var(--mdui-typescale-label-large-tracking) !important;
    box-shadow: var(--mdui-elevation-level1) !important;
    transition: box-shadow 0.2s ease !important;
}

#spotlight .spl-button:hover {
    box-shadow: var(--mdui-elevation-level2) !important;
}

/* 加载动画：使用 MDUI primary 颜色 */
#spotlight .spl-spinner.spin {
    filter: none !important;
}

/* 注意：不要覆盖 .spl-pane 的 left 属性！
   Spotlight 库通过给每个 pane 设置 left: 100% * index 来水平排列多张图片 */

/* 防止Spotlight打开时页面滚动 */
body.spotlight-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* 页脚样式 */
.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    text-align: center;
    font-size: 14px;
    color: rgb(var(--mdui-color-on-surface-variant));
}

.footer-content span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-content a {
    color: rgb(var(--mdui-color-primary));
    text-decoration: none;
}

.footer-content a:hover {
    color: rgb(var(--mdui-color-primary-container-light));
    text-decoration: underline;
}

/* 页脚芯片组件样式 */
.footer-content mdui-chip {
    --mdui-chip-label-text-size: 14px;
    --mdui-chip-leading-icon-size: 16px;
    text-decoration: none !important;
    color: inherit !important;
}

@media screen and (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 8px;
    }
}

/* ==================== PJAX 相关样式 ==================== */

/* PJAX容器过渡动画 */
#pjax-container {
    transition: opacity 0.2s ease-in-out;
}

/* 页面加载时的淡入效果 */
.pjax-fade-in {
    animation: pjaxFadeIn 0.3s ease-in-out;
}

@keyframes pjaxFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 链接点击时的视觉反馈 */
a[href]:active {
    opacity: 0.7;
}

/* 确保PJAX加载时页面不会跳动 */
html {
    scroll-behavior: smooth;
}

/* PJAX加载状态指示器 */
.pjax-loading {
    position: relative;
}

.pjax-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(var(--mdui-color-primary), 0.3);
    border-top-color: rgb(var(--mdui-color-primary));
    border-radius: 50%;
    animation: pjaxSpin 0.8s linear infinite;
}

@keyframes pjaxSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== 样式提示卡片 (mdui-card) ==================== */
mdui-card.mdui-note {
    display: block;
    padding: 16px 20px;
    margin: 16px 0;
    border-left: 4px solid;
    font-size: var(--mdui-typescale-body-large-size, 16px);
    line-height: var(--mdui-typescale-body-large-line-height, 1.5);
    --shape-corner: var(--mdui-shape-corner-medium, 12px);
}

mdui-card.mdui-note mdui-icon {
    font-size: 22px;
    vertical-align: middle;
    margin-right: 8px;
}

mdui-card.mdui-note .mdui-note-content {
    display: inline;
    vertical-align: middle;
}

/* 红色提示卡片 */
mdui-card.mdui-note-red {
    background: rgba(var(--mdui-color-error, 186 26 26), 0.08);
    border-left-color: rgb(var(--mdui-color-error, 186 26 26));
    color: rgb(var(--mdui-color-on-surface, 28 27 31));
}

mdui-card.mdui-note-red mdui-icon {
    color: rgb(var(--mdui-color-error, 186 26 26));
}

/* 黄色提示卡片 */
mdui-card.mdui-note-yellow {
    background: rgba(255, 160, 0, 0.08);
    border-left-color: #ffa000;
    color: rgb(var(--mdui-color-on-surface, 28 27 31));
}

mdui-card.mdui-note-yellow mdui-icon {
    color: #ffa000;
}

/* 绿色提示卡片 */
mdui-card.mdui-note-green {
    background: rgba(67, 160, 71, 0.08);
    border-left-color: #43a047;
    color: rgb(var(--mdui-color-on-surface, 28 27 31));
}

mdui-card.mdui-note-green mdui-icon {
    color: #43a047;
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    mdui-card.mdui-note-red {
        background: rgba(207, 102, 121, 0.12);
        border-left-color: rgb(207, 102, 121);
    }
    mdui-card.mdui-note-red mdui-icon {
        color: rgb(207, 102, 121);
    }
    mdui-card.mdui-note-yellow {
        background: rgba(255, 203, 107, 0.12);
        border-left-color: rgb(255, 203, 107);
    }
    mdui-card.mdui-note-yellow mdui-icon {
        color: rgb(255, 203, 107);
    }
    mdui-card.mdui-note-green {
        background: rgba(129, 199, 132, 0.12);
        border-left-color: rgb(129, 199, 132);
    }
    mdui-card.mdui-note-green mdui-icon {
        color: rgb(129, 199, 132);
    }
}

/* ==================== 折叠面板 (mdui-collapse) ==================== */
.mdui-prose mdui-list {
    display: block;
    margin: 16px 0;
    padding: 0;
    border-radius: var(--mdui-shape-corner-medium, 12px);
    overflow: hidden;
    border: 1px solid rgb(var(--mdui-color-outline-variant, 202, 196, 208));
}

.mdui-prose mdui-collapse {
    display: block;
}

.mdui-prose mdui-collapse-item {
    display: block;
}

.mdui-prose .m3ui-collapse-body {
    padding: 20px;
    color: rgb(var(--mdui-color-on-surface-variant, 73, 69, 79));
    line-height: 1.7;
}

/* ==================== 图片灯箱 (m3ui_image) ==================== */
.m3ui-gallery {
    margin: 24px 0;
    display: grid;
    gap: 12px;
}

/* 覆盖 MDUI prose 默认的 img margin */
.m3ui-gallery mdui-card.m3ui-gallery-item img {
    margin: 0 !important;
    max-width: none !important;
}

mdui-card.m3ui-gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    padding: 0 !important;
    box-shadow: var(--mdui-elevation-level1) !important;
    transition: box-shadow 0.2s ease !important;
}

mdui-card.m3ui-gallery-item:hover {
    box-shadow: var(--mdui-elevation-level3) !important;
}

mdui-card.m3ui-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

mdui-card.m3ui-gallery-item:hover img {
    transform: none;
}

.m3ui-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    font-size: var(--mdui-typescale-label-medium-size);
    color: rgb(var(--mdui-color-on-surface));
    text-align: center;
    background: rgba(var(--mdui-color-surface), 0.85);
    backdrop-filter: blur(4px);
}

@media screen and (max-width: 768px) {
    .m3ui-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    /* 单张图时全宽 */
    .m3ui-gallery:has(> .m3ui-gallery-item:only-child) {
        grid-template-columns: 1fr !important;
    }
}
