.zib-random-posts-widget {
    background: #fff;
    padding: 0;
    margin: 0;
}

.zib-random-header {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 0 5px 0;
    border-bottom: 1px solid #e8e8e8;
}

.jingxuan-icon {
    width: 120px;
    height: auto;
    margin-right: 10px;
}

.refresh-section {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
    width: 150px;
    justify-content: flex-end;
    gap: 8px;
}

.refresh-icon {
    width: 24px;
    height: 24px;
}

.refresh-text {
    font-size: 16px;
    font-weight: 600;
}

.refresh-section:hover {
    color: #1890ff;
}

.zib-random-post-item {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 12px 0;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 0;
}

.zib-random-post-item:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    padding-left: 5px;
    padding-right: 5px;
}

/* 悬停时同时显示缩略图和标题效果 */
.zib-random-post-item:hover .post-thumbnail img {
    transform: scale(1.1);
}

.zib-random-post-item:hover .post-thumbnail {
    transform: scale(1.05);
}

.zib-random-post-item:hover .post-title a {
    transform: scale(1.05);
    display: inline-block;
}

.zib-random-post-item + .zib-random-post-item {
    border-top: 1px solid #e8ecf3;
    margin-top: 2px;
}

/* 文章间分隔线美化 */
.zib-random-post-item:not(:last-child):after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e2e8f0 50%, transparent 100%);
}

/* 数字角标模式 - 统一大小 */
.post-number {
    flex-shrink: 0;
    margin-right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-number img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* 缩略图模式 */
.post-thumbnail {
    flex-shrink: 0;
    margin-right: 12px;
    width: 60px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}

/* 单独悬停缩略图时的效果 */
.post-thumbnail:hover img {
    transform: scale(1.1);
}

.post-thumbnail:hover {
    transform: scale(1.05);
}

.post-content {
    flex-grow: 1;
    min-width: 0;
}

.post-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
}

.post-title a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-title a:hover {
    color: #1890ff;
}

.zib-random-posts {
    position: relative;
}

/* 标题悬停放大效果 */
.post-title a {
    transition: all 0.3s ease;
}

.post-title a:hover {
    transform: scale(1.05);
    display: inline-block;
}

/* 确保缩略图显示 */
.post-thumbnail {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-thumbnail:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* 缩略图占位符 */
.post-thumbnail:after {
    content: '📷';
    font-size: 16px;
    color: #999;
    position: absolute;
    z-index: 2;
    display: none;
}

.post-thumbnail:not(:has(img)):after {
    display: block;
}

/* 昼夜模式适配 - 子比主题兼容 */
@media (prefers-color-scheme: dark) {
    .zib-random-posts-widget {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .zib-random-header {
        border-bottom-color: #333;
    }
    
    .jingxuan-icon {
        filter: brightness(0.9);
    }
    
    .refresh-section {
        color: #b0b0b0;
    }
    
    .refresh-section:hover {
        color: #3b82f6;
    }
    
    .refresh-icon {
        filter: invert(0.8);
    }
    
    .zib-random-post-item {
        border-color: #333;
    }
    
    .zib-random-post-item:hover {
        background: linear-gradient(135deg, #2a2f3d 0%, #1e2430 100%);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    
    .post-title a {
        color: #e0e0e0;
    }
    
    .post-title a:hover {
        color: #3b82f6;
        text-shadow: 0 0 1px rgba(59, 130, 246, 0.3);
    }
    
    .zib-random-post-item + .zib-random-post-item {
        border-top-color: #333;
    }
    
    /* 文章间分隔线 */
    .zib-random-post-item:not(:last-child):after {
        background: linear-gradient(90deg, transparent 0%, #333 50%, transparent 100%);
    }
    
    /* 缩略图背景 */
    .post-thumbnail {
        background: #2a2a2a;
    }
    
    .post-thumbnail:before {
        background: rgba(0, 0, 0, 0.3);
    }
    
    .post-thumbnail:after {
        color: #888;
    }
    
    /* 数字角标适配 */
    .post-number img {
        filter: invert(0.9);
    }
}

/* 子比主题暗色模式适配 - 跟随主题暗夜背景色 */
[class*="dark"] .zib-random-posts-widget,
[class*="night"] .zib-random-posts-widget,
body[class*="dark"] .zib-random-posts-widget,
body[class*="night"] .zib-random-posts-widget,
html[class*="dark"] .zib-random-posts-widget,
html[class*="night"] .zib-random-posts-widget,
[data-theme*="dark"] .zib-random-posts-widget,
[data-theme*="night"] .zib-random-posts-widget,
.zib-random-posts-widget.dark,
.zib-random-posts-widget.night {
    background: inherit !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[class*="dark"] .zib-random-header,
[class*="night"] .zib-random-header,
body[class*="dark"] .zib-random-header,
body[class*="night"] .zib-random-header,
html[class*="dark"] .zib-random-header,
html[class*="night"] .zib-random-header,
[data-theme*="dark"] .zib-random-header,
[data-theme*="night"] .zib-random-header {
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

[class*="dark"] .refresh-section,
[class*="night"] .refresh-section,
body[class*="dark"] .refresh-section,
body[class*="night"] .refresh-section,
html[class*="dark"] .refresh-section,
html[class*="night"] .refresh-section,
[data-theme*="dark"] .refresh-section,
[data-theme*="night"] .refresh-section {
    color: #ffffff !important;
}

[class*="dark"] .refresh-section:hover,
[class*="night"] .refresh-section:hover,
body[class*="dark"] .refresh-section:hover,
body[class*="night"] .refresh-section:hover,
html[class*="dark"] .refresh-section:hover,
html[class*="night"] .refresh-section:hover,
[data-theme*="dark"] .refresh-section:hover,
[data-theme*="night"] .refresh-section:hover {
    color: #1890ff !important;
}

[class*="dark"] .zib-random-post-item,
[class*="night"] .zib-random-post-item,
body[class*="dark"] .zib-random-post-item,
body[class*="night"] .zib-random-post-item,
html[class*="dark"] .zib-random-post-item,
html[class*="night"] .zib-random-post-item,
[data-theme*="dark"] .zib-random-post-item,
[data-theme*="night"] .zib-random-post-item {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[class*="dark"] .zib-random-post-item:hover,
[class*="night"] .zib-random-post-item:hover,
body[class*="dark"] .zib-random-post-item:hover,
body[class*="night"] .zib-random-post-item:hover,
html[class*="dark"] .zib-random-post-item:hover,
html[class*="night"] .zib-random-post-item:hover,
[data-theme*="dark"] .zib-random-post-item:hover,
[data-theme*="night"] .zib-random-post-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

[class*="dark"] .post-title a,
[class*="night"] .post-title a,
body[class*="dark"] .post-title a,
body[class*="night"] .post-title a,
html[class*="dark"] .post-title a,
html[class*="night"] .post-title a,
[data-theme*="dark"] .post-title a,
[data-theme*="night"] .post-title a {
    color: #ffffff !important;
}

[class*="dark"] .post-title a:hover,
[class*="night"] .post-title a:hover,
body[class*="dark"] .post-title a:hover,
body[class*="night"] .post-title a:hover,
html[class*="dark"] .post-title a:hover,
html[class*="night"] .post-title a:hover,
[data-theme*="dark"] .post-title a:hover,
[data-theme*="night"] .post-title a:hover {
    color: #1890ff !important;
}

[class*="dark"] .zib-random-post-item + .zib-random-post-item,
[class*="night"] .zib-random-post-item + .zib-random-post-item,
body[class*="dark"] .zib-random-post-item + .zib-random-post-item,
body[class*="night"] .zib-random-post-item + .zib-random-post-item,
html[class*="dark"] .zib-random-post-item + .zib-random-post-item,
html[class*="night"] .zib-random-post-item + .zib-random-post-item,
[data-theme*="dark"] .zib-random-post-item + .zib-random-post-item,
[data-theme*="night"] .zib-random-post-item + .zib-random-post-item {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

[class*="dark"] .post-thumbnail,
[class*="night"] .post-thumbnail,
body[class*="dark"] .post-thumbnail,
body[class*="night"] .post-thumbnail,
html[class*="dark"] .post-thumbnail,
html[class*="night"] .post-thumbnail,
[data-theme*="dark"] .post-thumbnail,
[data-theme*="night"] .post-thumbnail {
    background: #f0f0f0 !important;
}

[class*="dark"] .post-thumbnail:before,
[class*="night"] .post-thumbnail:before,
body[class*="dark"] .post-thumbnail:before,
body[class*="night"] .post-thumbnail:before,
html[class*="dark"] .post-thumbnail:before,
html[class*="night"] .post-thumbnail:before,
[data-theme*="dark"] .post-thumbnail:before,
[data-theme*="night"] .post-thumbnail:before {
    background: rgba(0, 0, 0, 0.1) !important;
}

[class*="dark"] .post-thumbnail:after,
[class*="night"] .post-thumbnail:after,
body[class*="dark"] .post-thumbnail:after,
body[class*="night"] .post-thumbnail:after,
html[class*="dark"] .post-thumbnail:after,
html[class*="night"] .post-thumbnail:after,
[data-theme*="dark"] .post-thumbnail:after,
[data-theme*="night"] .post-thumbnail:after {
    color: #999 !important;
}

[class*="dark"] .post-number img,
[class*="night"] .post-number img,
body[class*="dark"] .post-number img,
body[class*="night"] .post-number img,
html[class*="dark"] .post-number img,
html[class*="night"] .post-number img,
[data-theme*="dark"] .post-number img,
[data-theme*="night"] .post-number img {
    filter: none !important;
}

/* 子比主题特定暗色模式类名 - 跟随主题暗夜背景色 */
body.zib-night .zib-random-posts-widget,
body.zib-dark .zib-random-posts-widget,
.zib-night .zib-random-posts-widget,
.zib-dark .zib-random-posts-widget,
.zib-theme-night .zib-random-posts-widget,
.zib-theme-dark .zib-random-posts-widget {
    background: inherit !important;
    color: #ffffff !important;
}

/* 强制暗色模式覆盖 - 跟随主题暗夜背景色 */
.zib-random-posts-widget[data-theme="dark"],
.zib-random-posts-widget.dark-mode,
.zib-random-posts-widget.night-mode {
    background: inherit !important;
    color: #ffffff !important;
}

/* 强制暗色模式覆盖 */
.zib-random-posts-widget[data-theme="dark"],
.zib-random-posts-widget.dark-mode {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .zib-random-posts-widget {
        padding: 12px;
    }
    
    .jingxuan-icon {
        width: 100px;
    }
    
    .refresh-section {
        width: 140px;
    }
    
    .refresh-icon {
        width: 22px;
        height: 22px;
    }
    
    .refresh-text {
        font-size: 15px;
    }
    
    .post-thumbnail {
        width: 50px;
        height: 35px;
    }
    
    .post-title {
        font-size: 13px;
        font-weight: 600;
    }
    
    .post-number {
        width: 35px;
        height: 35px;
    }
    
    .post-number img {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .jingxuan-icon {
        width: 80px;
    }
    
    .refresh-section {
        width: 120px;
    }
    
    .refresh-icon {
        width: 20px;
        height: 20px;
    }
    
    .refresh-text {
        font-size: 14px;
    }
    
    .post-thumbnail {
        width: 45px;
        height: 30px;
    }
    
    .post-number {
        width: 30px;
        height: 30px;
    }
    
    .post-number img {
        width: 24px;
        height: 24px;
    }
}