/*
 * 友情链接关系图表样式
 * @author 友人a丶
 * @date 2024-01-18
 */

.friend-graph {
    position: relative;
    width: 100%;
    user-select: none;
    min-height: calc(100vh - 100px);
    border-radius: 8px;
    padding: 60px 0 0;
    overflow: hidden;
}

#friend-edges {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.friend-edge {
    stroke: #e0e0e0;
    stroke-width: 1;
    transition: stroke 0.3s;
}

.friend-node {
    position: absolute;
    width: 3.8rem;
    cursor: move;
    z-index: 2;
    transition: transform 0.3s;
}

.friend-node.dragging {
    z-index: 3;
    transform: scale(1.05);
}

.node-icon {
    display: flex;
    justify-content: center;
    align-items: center;

    width: 3.8rem;
    height: 3.8rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: #fff;
    margin-bottom: 8px;
}

.node-icon img {
    width: 75%;
    height: 75%;
    pointer-events: none;
    user-select: none;
    object-fit: cover;
}

.node-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    position: absolute;
    width: 240px;
    left: 50%;
    z-index: 1001;
    transform: translateX(-50%);
}

.friend-node:hover{
    z-index: 1001;
}
.friend-node:hover .node-info {
    opacity: 1;
}

.friend-apply-trigger {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    border: 1px solid var(--theme-color, #3eaf7c);
    border-radius: 999px;
    padding: 11px 20px;
    color: var(--theme-color, #3eaf7c);
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    font-weight: 700;
    cursor: pointer;
}

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

.friend-apply-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.friend-apply-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.friend-apply-dialog {
    position: relative;
    width: min(92vw, 520px);
    max-height: 90vh;
    margin: 5vh auto 0;
    overflow-y: auto;
    padding: 28px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
}

.friend-apply-dialog h2 {
    margin: 0 0 8px;
}

.friend-apply-tip {
    margin: 0 0 20px;
    color: #777;
    font-size: 13px;
}

.friend-apply-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    color: #777;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.friend-apply-dialog label {
    display: block;
    margin-bottom: 14px;
}

.friend-apply-dialog label span {
    display: block;
    margin-bottom: 6px;
    color: #444;
    font-size: 13px;
}

.friend-apply-dialog input,
.friend-apply-dialog textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 9px 10px;
    background: #fff;
}

.friend-apply-message {
    min-height: 20px;
    margin: 4px 0 10px;
    color: #d33;
    font-size: 13px;
}

.friend-apply-message.success {
    color: #258a58;
}

.friend-apply-submit {
    width: 100%;
    border: 0;
    border-radius: 4px;
    padding: 10px;
    color: #fff;
    background: var(--theme-color, #3eaf7c);
    cursor: pointer;
}

.node-info h3 {
    margin: 0 0 4px;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
    display: -webkit-box;
    overflow: hidden;
}


@media (max-width: 767px) {

    .friend-apply-trigger {
        right: 16px;
        bottom: 16px;
    }

    .friend-apply-dialog {
        padding: 24px 18px;
    }

    .friend-node {
        position: absolute;
        width: 2.5rem;
    }

    .node-icon {
        width: 2.5rem;
        height: 2.5rem;
    }

}
