.postlink .dropdown-menu {
    width: 360px;
    max-width: min(90vw, 420px);
    padding: 0;
    box-sizing: border-box;
}

.dropdown-postlink {
    padding: 10px;
}

.dropdown-postlink p {
    margin-bottom: 8px;
}

.dropdown-postlink .post-link-search {
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--main-border-color, rgba(0, 0, 0, 0.08));
    background: var(--main-bg-color, #fff);
}

.dropdown-postlink .post-link-search:focus {
    border-color: color-mix(in srgb, var(--focus-color, #409eff) 40%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus-color, #409eff) 14%, transparent);
}

.post-link-results {
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--main-border-color, rgba(0, 0, 0, 0.06));
    border-radius: 10px;
    background: var(--main-bg-color, #fff);
}

.post-link-results::-webkit-scrollbar {
    width: 6px;
}

.post-link-results::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--muted-border-color, rgba(0, 0, 0, 0.12));
}

.post-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--main-border-color, rgba(0, 0, 0, 0.05));
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.post-link-item-thumb {
    width: 56px;
    min-width: 56px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--muted-border-color, rgba(0, 0, 0, 0.06));
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-link-item-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.post-link-item-body {
    min-width: 0;
    flex: 1;
}

.post-link-item:last-child {
    border-bottom: 0;
}

.post-link-item:hover,
.post-link-item.active {
    background: color-mix(in srgb, var(--focus-color, #409eff) 10%, transparent);
    border-color: color-mix(in srgb, var(--focus-color, #409eff) 25%, transparent);
    text-decoration: none;
}

.post-link-item.is-current .post-link-item-title::before {
    content: "当前";
    display: inline-block;
    margin-right: 6px;
    padding: 0 6px;
    line-height: 18px;
    border-radius: 999px;
    font-size: 11px;
    color: var(--focus-color, #409eff);
    background: color-mix(in srgb, var(--focus-color, #409eff) 12%, transparent);
    vertical-align: 1px;
}

.post-link-item-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--main-color, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-link-item-meta {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted-2-color, #8a8a8a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-link-empty {
    padding: 20px 10px;
    text-align: center;
    color: var(--muted-2-color, #8a8a8a);
    font-size: 12px;
}

.zibtf-comment-link-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 8px;
    padding: 2px 0;
    overflow: visible;
}

.zibtf-comment-link-chip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--focus-color, #409eff);
    background: color-mix(in srgb, var(--focus-color, #409eff) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--focus-color, #409eff) 26%, transparent);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease, color 0.22s ease;
    position: relative;
    z-index: 1;
}

.zibtf-comment-link-chip-link {
    display: inline-block;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    text-decoration: none;
}

.zibtf-comment-link-chip-remove {
    margin-left: 6px;
    flex: 0 0 auto;
    line-height: 1;
    opacity: 0.7;
    cursor: pointer;
    font-style: normal;
}

.zibtf-comment-link-chip:hover {
    color: var(--focus-color, #409eff);
    background: color-mix(in srgb, var(--focus-color, #409eff) 18%, transparent);
    border-color: color-mix(in srgb, var(--focus-color, #409eff) 45%, transparent);
    box-shadow: none;
    transform: translateY(-1px);
    text-decoration: none;
    z-index: 3;
}

.zibtf-comment-link-chip:hover .zibtf-comment-link-chip-link,
.zibtf-comment-link-chip:focus-within .zibtf-comment-link-chip-link {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-all;
}

.comment-content .zibtf-comment-post-card {
    margin-top: 8px;
}

.comment-content .zibtf-comment-post-card + .zibtf-comment-post-card {
    margin-top: 10px;
}

.zibtf-comment-post-card-link {
    display: flex;
    gap: 10px;
    align-items: stretch;
    padding: 9px;
    border-radius: 12px;
    border: 1px solid var(--main-border-color, rgba(0, 0, 0, 0.08));
    background: var(--main-bg-color, #fff);
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.zibtf-comment-post-card-link:hover {
    text-decoration: none;
    border-color: color-mix(in srgb, var(--focus-color, #409eff) 30%, transparent);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.zibtf-comment-post-thumb {
    width: 132px;
    min-width: 132px;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 9px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
}

#postcomments .comment-content .zibtf-comment-post-thumb img.zibtf-comment-post-thumb-img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
}

.zibtf-comment-post-main {
    min-width: 0;
    flex: 1;
}

.zibtf-comment-post-title {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--main-color, #333);
    max-height: 2.8em;
    overflow: hidden;
}

.zibtf-comment-post-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted-2-color, #8a8a8a);
    font-size: 12px;
}

.zibtf-comment-post-badge {
    display: inline-block;
    padding: 0 8px;
    height: 20px;
    line-height: 20px;
    border-radius: 999px;
    color: var(--focus-color, #409eff);
    background: color-mix(in srgb, var(--focus-color, #409eff) 12%, transparent);
}

@media (max-width: 768px) {
    .drop-fixed-sm.postlink .dropdown-menu {
        width: auto !important;
        max-width: none !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        overflow-x: hidden;
    }

    .postlink .dropdown-menu {
        width: min(92vw, 420px);
        max-width: calc(100vw - 16px);
        left: auto;
        right: 0;
    }

    .zibtf-comment-post-thumb {
        width: 108px;
        min-width: 108px;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .dropdown-postlink {
        padding: 8px;
        overflow-x: hidden;
    }

    .post-link-item-thumb {
        width: 50px;
        min-width: 50px;
        height: 32px;
    }

    .dropdown-postlink .text-right {
        display: none;
    }

    .post-link-item-meta {
        white-space: normal;
        word-break: break-all;
    }
}
