/* ==========================================================================
   友情链接页（links.html）
   ========================================================================== */

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.link-card__avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-primary-light);
    border: 1px solid var(--color-border);
}

.link-card__body {
    min-width: 0;
}

.link-card__name {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-card__desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-sub);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- 交换友链信息 ---- */
.links-swap__hint {
    font-size: 14px;
    color: var(--color-text-sub);
    margin: 0 0 14px;
}

.links-swap__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 18px;
    margin: 0;
}

.links-swap__list > div {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.links-swap__list dt {
    color: var(--color-text-muted);
    flex: 0 0 72px;
}

.links-swap__list dd {
    margin: 0;
    word-break: break-all;
}

/* ---- 申请表单 ---- */
.links-apply .apply-field {
    margin-bottom: 14px;
}

.links-apply label {
    display: block;
    font-size: 13px;
    color: var(--color-text-sub);
    margin-bottom: 6px;
}

.links-apply input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.9);
}

.links-apply input:focus {
    outline: 2px solid var(--color-primary-light);
    border-color: var(--color-primary);
}

.apply-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: 4px 0 14px;
    border: 1px dashed var(--color-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
}

.apply-preview[hidden] {
    display: none;
}

.apply-preview img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-primary-light);
}

.apply-preview__name {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 3px;
}

.apply-preview__desc {
    font-size: 13px;
    color: var(--color-text-sub);
    margin: 0;
}

.apply-msg {
    font-size: 13px;
    margin: 0 0 12px;
    min-height: 18px;
}

.apply-msg.is-error {
    color: #d93025;
}

.apply-msg.is-ok {
    color: #1a7f37;
}

.links-empty {
    font-size: 14px;
    color: var(--color-text-muted);
    padding: 8px 0;
}

@media (max-width: 768px) {
    .links-grid {
        grid-template-columns: 1fr;
    }
    .links-swap__list {
        grid-template-columns: 1fr;
    }
}
