/* URL输入框和头像预览样式 */

/* URL输入框增强样式 */
input[type="url"] {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px !important;
    padding: 12px 15px 12px 35px !important; /* 左侧留出图标空间 */
    transition: all 0.3s ease;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.5)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>');
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 16px;
}

/* URL输入框焦点状态 */
input[type="url"]:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-2px);
}

/* URL输入框验证状态 */
input[type="url"]:valid {
    border-color: rgba(0, 255, 100, 0.5) !important;
    box-shadow: 0 0 0 1px rgba(0, 255, 100, 0.2) !important;
}

input[type="url"]:invalid:not(:placeholder-shown) {
    border-color: rgba(255, 100, 100, 0.5) !important;
    box-shadow: 0 0 0 1px rgba(255, 100, 100, 0.2) !important;
}

/* 头像预览容器 */
.avatar-preview-container {
    position: relative;
    margin-top: 10px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
    display: none; /* 默认隐藏，有有效链接时显示 */
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.avatar-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview-container.show {
    display: block;
}

/* 头像预览加载状态 */
.avatar-preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-preview-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* URL输入提示信息 */
.url-input-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
    display: none;
}

.url-input-hint.show {
    display: block;
}

.url-input-hint.valid {
    color: rgba(0, 255, 100, 0.7);
}

.url-input-hint.invalid {
    color: rgba(255, 100, 100, 0.7);
}