/* ============================================
   UI/UX 优化样式 - Custom Hook
   ============================================ */

/* 1. 覆盖间距变量 - 增加"呼吸感" */
:root {
    --columnGutter: 16px !important;
    --columnWidthOuter: calc(190px + var(--columnGutter)) !important;
}

/* 2. 图片文字可读性 - 渐变遮罩 */
.list-item-image {
    position: relative;
}

.list-item-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25%;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 1;
    border-radius: 0 0 8px 8px;
}

/* 确保文字在渐变层之上 */
.list-item-desc {
    z-index: 2;
}

/* 3. 图片卡片圆角 */
.list-item {
    border-radius: 8px;
    overflow: hidden;
}

.list-item-image img,
.list-item-image a {
    border-radius: 8px;
}

/* 4. 增加间距 */
.gutter-margin-right,
.gutter-margin-right-bottom {
    margin-inline-end: 16px !important;
}

.gutter-margin-bottom,
.gutter-margin-right-bottom,
.gutter-margin-left-bottom {
    margin-bottom: 16px !important;
}

.gutter-margin-left,
.gutter-margin-left-bottom {
    margin-inline-start: 16px !important;
}

.gutter-width {
    width: 16px !important;
}

/* 5. 全局隐藏 top-sub-bar（排序已移到顶部导航栏） */
.top-sub-bar.follow-scroll {
    display: none !important;
}

/* 6. 导航栏分隔线 */
.top-bar-divider {
    width: 1px;
    height: 50%;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 8px;
    align-self: center;
    list-style: none;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .top-bar-divider {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* 亮色模式 */
.palette-light .top-bar-divider {
    background: rgba(0, 0, 0, 0.12);
}

/* 排序按钮样式优化 */
#top-bar-sort .top-btn-text {
    opacity: 0.85;
}

#top-bar-sort:hover .top-btn-text {
    opacity: 1;
}

/* 7. 导航栏不换行 + 统一间距 */
.top-bar--main .top-bar-left {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 0 !important;
}

.top-bar--main .top-bar-left > li {
    flex-shrink: 0;
    margin: 0 !important;
    padding: 0 !important;
}

/* 统一所有导航按钮的左右内边距 */
.top-bar--main .top-bar-left .top-btn-text {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* 分隔线使用相同间距 */
.top-bar--main .top-bar-divider {
    margin: 0 8px !important;
}

/* 8. 修复图片文件名字体被截断 */
.list-item-desc,
.list-item-desc a {
    line-height: 1.4 !important;
    padding-top: 2px;
}

.list-item-desc {
    overflow: visible !important;
}

/* 确保图片卡片内容不被裁剪 */
.list-item .list-item-desc {
    clip-path: none;
}